<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>The &quot;xmlrpc&quot; and &quot;xmlrpcs&quot; URL scheme</title>
<meta name="title" content="The &quot;xmlrpc&quot; and &quot;xmlrpcs&quot; URL scheme" />
<meta name="author" content="mah@everybody.org" />
<style type="text/css">
@import "/mah.css";
<!-- Old browsers can't touch this -->
</style>
</head>
<body>
<div id="header">
<p><a href="/">top</a>::<a href="/docs/">docs</a>
</p>
<h1>The &quot;xmlrpc&quot; and &quot;xmlrpcs&quot; URL scheme</h1>
by <a href="http://mah.everybody.org/">Mark A. Hershberger</a> (<a href="http://mah.everybody.org/weblog/">weblog</a>)
</div>
<div id="googlead">
<script type="text/javascript"><!--
google_ad_client = "pub-3932658445533817";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "E0FFE3";
google_color_bg = "E0FFE3";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div id="main">

  <h2>Introduction</h2>
  <p>
    This document specifies how to interpret a url that uses the
    "xmlrpc" or "xmlrpcs" scheme.  The URL scheme is used to specify
    XML-RPC requests.  Responses are outside the scope of this
    document.
  </p>

  <h2>Description</h2>
  <p>
    <a href="http://www.xmlrpc.com/">XML-RPC</a> is a 'method for
    making Remote Procedure Calls (RPC) using HTTP as the
    transport and XML as the encoding".  The "xmlrpc" and
    "xmlrpcs" URL schemes defines how XML-RPC calls may be defined
    in a URL.  The responses to any request should be interpreted
    as described in the <a
      href="http://www.xmlrpc.com/spec">XML-RPC specification</a>
  </p>

  <p>
    If the "xmlrpc" scheme is used without specifying a port, then
    the well-known HTTP port 80 <b>MUST</b> be used.
  </p>

  <p>
    If the "xmlrpcs" scheme is used without specifying a port, then
    the well-known HTTP port 443 <b>MUST</b> be used and SSL transport
    protection <b>MUST</b> be used.
  </p>

  <h2>Syntax</h2>
  <p>
    The following BNF uses the syntax from <a
      href="http://www.ietf.org/rfc/rfc1738.txt">the
      URL BNF in RFC 1738 (section 5)</a> to describe the syntax of the "xmlrpc" scheme.</p>
  <pre>
	xmlrpcurl  := xmlrpcpref "://" login [ "/" path [ ";"
	              procedureName [ "?" arg "," arg ... ] ] ]

	xmlrpcpref := ( "xmlrpc" | "xmlrpcs" )

	procedureName := alphadigit

	arg := ( struct | array | type ":" data )

	array := "array(" arg "," ... arg ")"

	struct := "struct(" name "=" arg "," ... name "=" arg ")"

	name := alphadigit

	struct := "struct(" arg "," ... arg ")"

	type := ( "string" | "int" | "boolean" | "double" | "base64" |
        	  "dateTime.iso8601" )

	data := alpha | digit | safe
      </pre>

    <p>
      The above BNF <b>MUST NOT</b> be used to replace the XML-RPC
      specification in any way.  It simply defines the structure of
      an "xmlrpc" or "xmlrpcs" URL.
    </p>

    <h2>Examples</h2>
    <p>
      The following examples all come from <a
	href="http://www.xmlrpc.com/directory/1568/services">well
	known services</a>.   In most cases their sample requests have
      been used.
    </p>
    <h3>Time Request</h3>
  <pre>
xmlrpc://time.userland.com/RPC2;currentTime.getCurrentTime    
  </pre>
	  
  <p>The above URL would generate the following request:</p>

  <pre>
POST /RPC2 HTTP/1.0
Host: time.xmlrpc.com
Content-Type: text/xml
Content-length: 131

&lt;?xml version="1.0"?>
&lt;methodCall>
  &lt;methodName>currentTime.getCurrentTime&lt;/methodName>
  &lt;params>
  &lt;/params>
  &lt;/methodCall>
  </pre>

  <h3>Query of syndicated feed</h3>
  <pre>
xmlrpc://www.syndic8.com/xmlrpc.php;syndic8.FindFeeds?string:mah.everybody.org
  </pre>
  <p>A request for this URL would look like:</p>
  <pre>
POST /xmlrpc.php HTTP/1.0
Host: www.syndic8.com
Content-Type: text/xml
Content-length: 131

&lt;?xml version="1.0"?>
&lt;methodCall>
  &lt;methodName>syndic8.FindFeeds&lt;/methodName>
  &lt;params>
    &lt;value>
      &lt;string>mah.everybody.org&lt;string>
    &lt;/value>
  &lt;/params>
  &lt;/methodCall>
  </pre>

  <h3>Weblog Post</h3>
  <pre>
xmlrpc://plant.blogger.com/api/RPC2;blogger.newPost?string:C6CE3FFB3174106584CBB250C0B0519BF4E294,
string:744145,string:ewilliams,string:secret,string:Today%20I%20had%20a%20peanut%20butter%20and%20pickle%20sandwich%20for%20lunch.%20
Do%20you%20like%20peanut-butter%20and%20pickle%20sandwiches?%20I%20do.%20They're%20yummy.%20Please%20comment!,boolean:false
  </pre>
  <p>A request for this URL would look like:</p>
  <pre>
POST /api/RPC2 HTTP/1.0
Host: plant.blogger.com
Content-Type: text/xml
Content-length: 515

&lt;?xml version="1.0"?&gt;
&lt;methodCall&gt;
  &lt;methodName&gt;blogger.newPost&lt;/methodName&gt;
  &lt;params&gt;
     &lt;param&gt;&lt;value&gt;&lt;string&gt;C6CE3FFB3174106584CBB250C0B0519BF4E294&lt;/string&gt;&lt;/value&gt;&lt;/param&gt;
     &lt;param&gt;&lt;value&gt;&lt;string&gt;744145&lt;/string&gt;&lt;/value&gt;&lt;/param&gt;
     &lt;param&gt;&lt;value&gt;&lt;string&gt;ewilliams&lt;/string&gt;&lt;/value&gt;&lt;/param&gt;
     &lt;param&gt;&lt;value&gt;&lt;string&gt;secret&lt;/string&gt;&lt;/value&gt;&lt;/param&gt;
     &lt;param&gt;&lt;value&gt;&lt;string&gt;Today I had a peanut butter and pickle sandwich for lunch. Do you like peanut-butter and pickle sandwiches? I do. They're yummy. Please comment!&lt;/string&gt;&lt;/value&gt;&lt;/param&gt;
     &lt;param&gt;&lt;value&gt;&lt;boolean&gt;false&lt;/boolean&gt;&lt;/value&gt;&lt;/param&gt;&lt;/params&gt; &lt;/methodCall&gt; 
  </pre>

  <h3>Security</h3>
  <p>SSL may be used for transport protection.  The url scheme
    "xmlrpcs" should be used to indicate this.</p>
  <p>HTTP Authentication may be used for authentication.</p>
  <p>
    The effect of using long "xmlrpc" URLs in applications is
    currently unknown; some software packages may exhibit
    unreasonable behavior when confronted with URL lengths that
    exceeds its allocated buffer size.
  </p>
    
  <h3>References</h3>
    <p>The XML-RPC Specification (<a href="http://www.xmlrpc.com/spec">http://www.xmlrpc.com/spec</a>)</p>
    <p>Using XML-RPC in BEEP (<a
    href="http://www.ietf.org/internet-drafts/draft-harold-beep-xmlrpc-03.txt">http://www.ietf.org/internet-drafts/draft-harold-beep-xmlrpc-03.txt</a>)</p>
    <p>The "data" URL scheme (<a
    href="http://www.ietf.org/rfc/rfc2397.txt">RFC 2397</a>)</p>
</div>
<hr />
<div id="footer">
<table width="100%"><tr><td>
<address>
<a href="mailto:mah@everybody.org">mah@everybody.org</a>
</address>
<span class="modified">Last Modified: Sat Jul  9 21:22:30 2005</span>
</td><td align="right">

<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img src="http://jigsaw.w3.org/css-validator/images/vcss.gif"
     alt="Valid CSS!" height="31" width="88" /></a>

<a href="http://validator.w3.org/check/referer">
<img src="http://validator.w3.org/images/vxhtml10"
     alt="Valid XHTML 1.0!" height="31" width="88" /></a>

</td></tr></table>
</div>
</body></html>

