2
0

xmlrpc.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
  2. <title>Xmlrpc User Manual</title>
  3. <body>
  4. <p><b>xmlrpc</b> makes an XML-RPC remote procedure call (RPC) and displays
  5. the response. <b>xmlrpc</b> runs an XML-RPC client.
  6. <p>This program is mainly useful for debugging and learning about
  7. XML-RPC servers. XML-RPC is such that the RPCs normally need to be made
  8. by a program rather than a person to be of use.
  9. <p>A similar tool done as a web form is at <a
  10. href="http://gggeek.damacom.it/debugger/">
  11. http://gggeek.damacom.it/debugger/</a>
  12. <h2>Examples</h2>
  13. <pre>
  14. <tt>
  15. $ xmlrpc http://localhost:8080/RPC2 sample.add i/3 i/5
  16. Result:
  17. Integer: 8
  18. </tt>
  19. </pre>
  20. <pre>
  21. <tt>
  22. $ xmlrpc localhost:8080 sample.add i/3 i/5
  23. Result:
  24. Integer: 8
  25. </tt>
  26. </pre>
  27. <pre>
  28. <tt>
  29. $ xmlrpc http://xmlrpc.example.com/~bryanh echostring \
  30. &quot;s/This is a string&quot;
  31. Result:
  32. String: This is a string
  33. </tt>
  34. </pre>
  35. <pre>
  36. <tt>
  37. $ xmlrpc http://xmlrpc.example.com/~bryanh echostring \
  38. &quot;This is a string in shortcut syntax&quot;
  39. Result:
  40. String: This is a string in shortcut syntax
  41. </tt>
  42. </pre>
  43. <pre>
  44. <tt>
  45. $ xmlrpc http://xmlrpc.example.com sample.add i/3 i/5 \
  46. transport=curl -curlinterface=eth1 -username=bryanh -password=passw0rd
  47. Result:
  48. Integer: 8
  49. </tt>
  50. </pre>
  51. <h2>Overview</h2>
  52. <p>
  53. <b>xmlrpc</b>
  54. <i>url</i>
  55. <i>methodName</i>
  56. <i>parameter</i> ...
  57. [<b>-transport=</b><i>transportname</i>]
  58. [<b>-username=</b><i>username</i> <b>-password=</b><i>password</i>]
  59. [<b>-curlinterface</b>={<i>interface</i>|<i>host</i>}]
  60. [<b>-curlnoverifypeer</b>]
  61. [<b>-curlnoverifyhost</b>]
  62. <p><i>parameter</i>:
  63. <p>
  64. <b>i/</b><i>integer</i> |
  65. <b>s/</b><i>string</i> |
  66. <b>h/</b><i>hexstring</i> |
  67. <b>b/</b>{<b>true</b>|<b>false</b>|<b>t</b>|<b>f</b>} |
  68. <b>d/</b><i>realnum</i> |
  69. <b>n/</b> |
  70. <b><i>string</i></b>
  71. <P>Minimum unique abbreviation of option is acceptable. You may use double
  72. hyphens instead of single hyphen to denote options. You may use white
  73. space in place of the equals sign to separate an option name from its value.
  74. <h2>Arguments</h2>
  75. <dl>
  76. <dt><i>url</i>
  77. <dd>This is the URL of the XML-RPC server. As XML-RPC uses HTTP, this
  78. must be an HTTP url. However, if you don't specify a type (&quot;http:&quot;)
  79. in the URL, <b>xmlrpc</b> assumes an &quot;http://&quot; prefix and a
  80. &quot;/RPC2&quot; suffix. <b>RPC2</b> is the conventional file name for
  81. an XML-RPC responder.
  82. <dt><i>methodName</i>
  83. <dd>The name of the XML-RPC method you want to invoke.
  84. <dt><i>parameter</i> ...
  85. <dd>The list of parameters for the RPC. <b>xmlrpc</b> turns each of these
  86. arguments into an XML-RPC parameter, in the order given. You may specify
  87. no parameters if you like.
  88. <p>You specify the data type of the parameter with a prefix ending in
  89. a slash. Example: <b>i/5</b>. Here, the &quot;i&quot; signifies an
  90. integer data type. &quot;5&quot; is the value.
  91. <p><b>xmlrpc</b> is capable of only a subset of the
  92. possible XML-RPC types, as follows by prefix:
  93. <dl>
  94. <dt>i/
  95. <dd>integer (&lt;i4&gt;) (32 bit)
  96. <dt>s/
  97. <dd>string (&lt;string&gt;)
  98. <dt>h/
  99. <dd>byte string (&lt;base64&gt;). Specify the value in hexadecimal.
  100. <dt>b/
  101. <dd>boolean (&lt;boolean&gt;). Specify the value as &quot;true&quot; or
  102. &quot;t&quot; for true; &quot;false&quot; or &quot;f&quot; for false.
  103. <dt>d/
  104. <dd>double (&lt;double&gt;) (i.e. real number)
  105. <dt>n/
  106. <dd>nil (&lt;nil&gt;)
  107. <dt>I/
  108. <dd>64 bit integer (&lt;i8&gt;)
  109. </dl>
  110. <p>As a shortcut, if you don't specify a prefix (i.e. your argument does
  111. not contain a slash), <b>xmlrpc</b> assumes string data type.
  112. </dl>
  113. <h2>Options</h2>
  114. <dl>
  115. <dt><b>-transport=</b><i>transportname</i>
  116. <dd>This selects the XML transport facility (e.g. libwww) that
  117. <b>xmlrpc</b> uses to perform the RPC.
  118. <p>The name <i>transportname</i> is one that the Xmlrpc-c programming
  119. library recognizes. This is typically <b>libwww</b>, <b>curl</b>, and
  120. <b>wininet</b>.
  121. <p>By default, <b>xmlrpc</b> lets the Xmlrpc-c library choose.
  122. <dt><b>-username=</b><i>username</i>
  123. <dt><b>-password=</b><i>password</i>
  124. <dd>These options, which must be used together, cause the client to
  125. authenticate itself to the server, if the server requires it, using
  126. HTTP Basic Authentication and the specified username and password.
  127. <dt><b>-curlinterface</b>={<i>interface</i>|<i>host</i>}
  128. <dd>
  129. This option gives the &quot;interface&quot; option for a Curl XML transport.
  130. <p>The exact meaning of this option is up to the Curl library, and the
  131. best documentation for it is the manual for the 'curl' program that comes
  132. with the Curl library.
  133. <p>But essentially, it chooses the local network interface through which
  134. to send the RPC. It causes the Curl library to perform a
  135. &quot;bind&quot; operation on the socket it uses for the
  136. communication. It can be the name of a network interface (e.g. on
  137. Linux, &quot;eth1&quot;) or an IP address of the interface or a host
  138. name that resolves to the IP address of the interface. Unfortunately,
  139. you can't explicitly state which form you're specifying, so there's
  140. some ambiguity.
  141. <p>Examples:
  142. <ul>
  143. <li>
  144. <kbd>
  145. -interface=eth1
  146. </kbd>
  147. <li>
  148. <kbd>
  149. -interface=64.171.19.66
  150. </kbd>
  151. <li>
  152. <kbd>
  153. -interface=giraffe.giraffe-data.com
  154. </kbd>
  155. </ul>
  156. <p>This option causes <b>xmlrpc</b> to default to using the Curl
  157. XML transport. You may not specify any other transport.
  158. <dt><b>-curlnoverifypeer</b>
  159. <dd>
  160. This option gives the &quot;no_ssl_verifypeer&quot; option for the Curl
  161. XML transport, which is essentially the CURLOPT_SSL_VERIFYPEER option
  162. of the Curl library.
  163. <p>See the <b>curl_easy_setopt()</b> man page for details on this, but
  164. essentially it means that the client does not authenticate the server's
  165. certificate of identity -- it just believes whatever the server says.
  166. <p>You may want to use <b>-curlnoverifyhost</b> as well. Since you're
  167. not authenticating the server's identity, there's not much sense in
  168. checking it.
  169. <p>This option causes <b>xmlrpc</b> to default to using the Curl
  170. XML transport. You may not specify any other transport.
  171. <dt><b>-curlnoverifyhost</b>
  172. <dd>
  173. This option gives the &quot;no_ssl_verifyhost&quot; option for the Curl
  174. XML transport, which is essentially the CURLOPT_SSL_VERIFYHOST option
  175. of the Curl library.
  176. <p>See the <b>curl_easy_setopt()</b> man page for details on this, but
  177. essentially it means that the client does not verify the server's
  178. identity. It just assumes that if the server answers the IP address
  179. of the server as indicated by the URL (probably via host name), then
  180. it's the intended server.
  181. <p>You may want to use <b>-curlnoverifypeer</b> as well. As long as
  182. you don't care who the server says it is, there's no point in
  183. authenticating its identity.
  184. <p>This option causes <b>xmlrpc</b> to default to using the Curl
  185. XML transport. You may not specify any other transport.
  186. </dl>
  187. <h2>Limitations</h2>
  188. <p>If you run <b>xmlrpc</b> in an environment in which programs get
  189. their arguments encoded some way other than UTF-8, <b>xmlrpc</b>
  190. will generate garbage for the XML-RPC call and display garbage for
  191. the XML-RPC response. Typically, you control this aspect of the
  192. environment with a <b>LANG</b> environment variable. One safe value
  193. for <b>LANG</b> is &quot;C&quot;.
  194. </body>