xmlrpc is a general purpose XML-RPC client program. It performs one XML-RPC call, which you describe in its command line arguments.

Examples


     $ xmlrpc http://localhost:8080/RPC2 sample.add i/3 i/5
       Result:
         Integer: 8


     $ xmlrpc localhost:8080 sample.add i/3 i/5
       Result:
         Integer: 8
     


     $ xmlrpc http://xmlrpc.example.com/~bryanh echostring \
         "s/This is a string"
     Result:
       String: This is a string



     $ xmlrpc http://xmlrpc.example.com/~bryanh echostring \
         "This is a string in shortcut syntax"
     Result:
       String: This is a string in shortcut syntax



     $ xmlrpc localhost:8080 foo 'array/(i/3,i/5,s/hello)' \
          'struct/{width:d/8.5,height:d/11}'
     
     Result:
       Nil



     $ xmlrpc localhost:8080 foo 'array/(s/hello\(goodbye\))'
     Result:
       Nil



     $ xmlrpc http://xmlrpc.example.com sample.add i/3 i/5 \
         transport=curl -curlinterface=eth1 -username=bryanh -password=passw0rd
       Result:
         Integer: 8
     

Description

xmlrpc makes an XML-RPC remote procedure call (RPC) and displays the response. xmlrpc runs an XML-RPC client.

You specify the RPC parameters with command line arguments (See parameter under Arguments).

Each argument to xmlrpc describes on XML-RPC parameter. So in a typical command shell, the following would make an XML-RPC call with two parameters: "hello" and "see you later":


$ xmlrpc http://www.xmlrpc.com/RPC2 mymethod s/hello "s/see you later"

Note that this is an example of a Bourne shell command, so some of the characters (most notably the quotation marks) are part of the shell language, not the xmlrpc syntax.


$ xmlrpc http://www.oreillynet.com/meerkat/xml-rpc/server.php \
    meerkat.getItems \
    "struct/{search:linux,descriptions:i/76,time_period:12hour}"
Result:
  Array:
    Struct:
      title: String: DatabaseJournal: OpenEdge-Based Finance ...
      link: String: http://linuxtoday.com/news_story.php3?ltsn=...
      description: String: "Finance application with embedded ...
    Struct:
      title: ...
      link: ...
      description: ...



$ xmlrpc localhost:8080 array_processing_method \
    "array/(i/3,i/49,s/hello,array/(i/-10,i/-9))"

xmlrpc is implemented using the Xmlrpc-c client library, but its function is not in any way tied to Xmlrpc-c. It makes a standard XML-RPC call and does not know or care whether the server is implemented with Xmlrpc-c or not.

For extra diagnostic information, use the XMLRPC_TRACE_XML environment variable so you can see the XML that goes back and forth to perform the call. (This is not specifically xmlrpc function -- it's tracing function that's automatically there because xmlrpc uses libxmlrpc_client).

Warning About System Compatibility

xmlrpc from Xmlrpc-c before Release 1.16 doesn't work on some platforms — it crashes because of invalid assumptions it makes about the way C variadic functions are implemented.

Overview

xmlrpc url methodName parameter ... [-transport=transportname] [-username=username -password=password] [-curlinterface={interface|host}] [-curlnoverifypeer] [-curlnoverifyhost]

parameter:

i/integer | s/string | h/hexstring | b/{true|false|t|f} | d/realnum | n/ | string

Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value.

Arguments

url
This is the URL of the XML-RPC server. As XML-RPC uses HTTP, this must be an HTTP url. However, if you don't specify a type ("http:") in the URL, xmlrpc assumes an "http://" prefix and a "/RPC2" suffix. RPC2 is the conventional file name for an XML-RPC responder.

The port number defaults to 80 (the standard http service).

Examples:

methodName
The name of the XML-RPC method you want to invoke.
parameter ...
The list of parameters for the RPC. xmlrpc turns each of these arguments into an XML-RPC parameter, in the order given. You may specify no parameters if you like.

Examples:

You specify the data type of the parameter with a prefix ending in a slash. Example: i/5. Here, the "i" signifies an integer data type. "5" is the value.

xmlrpc is capable of only a subset of the possible XML-RPC types, as follows by prefix:

i/
integer (<i4>) (32 bit)
s/
string (<string>)

The parenthesis, brace, comma, colon, and backslash characters are special. If you want to include one in a string value, escape it with a backslash.

h/
byte string (<base64>). Specify the value in hexadecimal.
b/
boolean (<boolean>). Specify the value as "true" or "t" for true; "false" or "f" for false.
d/
double (<double>) (i.e. real number)
n/
nil (<nil>)
I/
64 bit integer (<i8>)
array/
Array (<array>). Specify the value as a list of items, separated by commas, between parentheses, like this:

struct/{width:d/8.5,height:d/11}

You can nest complex types, for example: struct/{width:d/8.5,height:d/11,colors:array/(blue,green,red)}

struct/
Struct (<struct>). Specify the value as a list of members, separated by commas, between braces, like this:

array/(i/3,i/5,s/hello)

You can nest complex types, for example: array/(i/3,array/(d/3.5, d/2.0),i/5,s/hello)

As a shortcut, if you don't specify a prefix (i.e. your argument does not contain a slash), xmlrpc assumes string data type.

xmlrpc cannot generate a parameter of datetime type.

Options

-transport=transportname
This selects the XML transport facility (e.g. libwww) that xmlrpc uses to perform the RPC.

The name transportname is one that the Xmlrpc-c programming library recognizes. This is typically libwww, curl, and wininet.

By default, xmlrpc lets the Xmlrpc-c library choose.

-username=username
-password=password
These options, which must be used together, cause the client to authenticate itself to the server, if the server requires it, using HTTP Basic Authentication and the specified username and password.
-curlinterface={interface|host}
This option gives the "interface" option for a Curl XML transport.

The exact meaning of this option is up to the Curl library, and the best documentation for it is the manual for the 'curl' program that comes with the Curl library.

But essentially, it chooses the local network interface through which to send the RPC. It causes the Curl library to perform a "bind" operation on the socket it uses for the communication. It can be the name of a network interface (e.g. on Linux, "eth1") or an IP address of the interface or a host name that resolves to the IP address of the interface. Unfortunately, you can't explicitly state which form you're specifying, so there's some ambiguity.

Examples:

This option causes xmlrpc to default to using the Curl XML transport. You may not specify any other transport.

-curlnoverifypeer
This option gives the "no_ssl_verifypeer" option for the Curl XML transport, which is essentially the CURLOPT_SSL_VERIFYPEER option of the Curl library.

See the curl_easy_setopt() man page for details on this, but essentially it means that the client does not authenticate the server's certificate of identity -- it just believes whatever the server says.

You may want to use -curlnoverifyhost as well. Since you're not authenticating the server's identity, there's not much sense in checking it.

This option causes xmlrpc to default to using the Curl XML transport. You may not specify any other transport.

-curlnoverifyhost
This option gives the "no_ssl_verifyhost" option for the Curl XML transport, which is essentially the CURLOPT_SSL_VERIFYHOST option of the Curl library.

See the curl_easy_setopt() man page for details on this, but essentially it means that the client does not verify the server's identity. It just assumes that if the server answers the IP address of the server as indicated by the URL (probably via host name), then it's the intended server.

You may want to use -curlnoverifypeer as well. As long as you don't care who the server says it is, there's no point in authenticating its identity.

This option causes xmlrpc to default to using the Curl XML transport. You may not specify any other transport.

-xmlsizelimit=n[K|M|G]
This gives the maximum size in characters of an RPC response that the program will accept.

The Xmlrpc-c libraries place a limit on the size of a response they will accept from the server to protect the rest of the program that uses the libraries from running out of memory. This option overrides the library default limit, which is 512K.

This option was new in Xmlrpc-c 1.55 (June 2019).

Limitations

If you run xmlrpc in an environment in which programs get their arguments encoded some way other than UTF-8, xmlrpc will generate garbage for the XML-RPC call and display garbage for the XML-RPC response. Typically, you control this aspect of the environment with a LANG environment variable. One safe value for LANG is "C".