cvs: peardoc /en/package/webservices/xml-rpc api.xml

From: Date: Mon, 14 Mar 2005 19:24:09 +0000
Subject: cvs: peardoc /en/package/webservices/xml-rpc api.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5668@lists.php.net to get a copy of this message
danielc Mon Mar 14 14:24:09 2005 EDT Modified files: /peardoc/en/package/webservices/xml-rpc api.xml Log: * send() does not have a $server_method parameter. * Fix XML_RPC_Client() parameters. * openssl is needed, not curl. * Don't use "" to encapsulate values/etc. Use appropriate tags. * Put CDATA around all programlistings. * Add xml declaration. # /me praying this doesn't kill the build.

http://cvs.php.net/diff.php/peardoc/en/package/webservices/xml-rpc/api.xml?r1=1.9&r2=1.10&ty=u Index: peardoc/en/package/webservices/xml-rpc/api.xml diff -u peardoc/en/package/webservices/xml-rpc/api.xml:1.9 peardoc/en/package/webservices/xml-rpc/api.xml:1.10 --- peardoc/en/package/webservices/xml-rpc/api.xml:1.9 Sat Jan 22 02:44:32 2005 +++ peardoc/en/package/webservices/xml-rpc/api.xml Mon Mar 14 14:24:08 2005 @@ -1,4 +1,6 @@ +<?xml version="1.0" encoding="iso-8859-1" ?> <!-- $revision: 1.3 $ --> + <refentry id="package.webservices.xml-rpc.api"> <refnamediv> @@ -22,30 +24,147 @@ <funcsynopsis> <funcprototype> <funcdef>$client = new XML_RPC_Client</funcdef> - <paramdef><parameter>$server_path</parameter></paramdef> - <paramdef><parameter>$server_hostname</parameter></paramdef> - <paramdef><parameter>$server_port</parameter></paramdef> + <paramdef> + string <parameter>$path</parameter> + </paramdef> + <paramdef> + string <parameter>$server</parameter> + </paramdef> + <paramdef> + integer <parameter><optional>$port</optional></parameter> + </paramdef> + <paramdef> + string <parameter><optional>$proxy</optional></parameter> + </paramdef> + <paramdef> + integer <parameter><optional>$proxy_port</optional></parameter> + </paramdef> + <paramdef> + string <parameter><optional>$proxy_user</optional></parameter> + </paramdef> + <paramdef> + string <parameter><optional>$proxy_pass</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> + <variablelist> + + <varlistentry> + <term> + &type.string; + <parameter>$path</parameter> + </term> + <listitem> + <para> + the path and name of the RPC server script + you want the request to go to + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + &type.string; + <parameter>$server</parameter> + </term> + <listitem> + <para> + the URL of the remote server to connect to. + If this parameter doesn't specify a + protocol and $port is 443, ssl:// is assumed. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + &type.int; + <parameter>$port</parameter> + </term> + <listitem> + <para> + a port for connecting to the remote server. + Defaults to 80 for http:// connections and + 443 for https:// and ssl:// connections. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + &type.string; + <parameter>$proxy</parameter> + </term> + <listitem> + <para> + the URL of the proxy server to use, if any. + If this parameter doesn't specify a + protocol and $port is 443, ssl:// is assumed. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + &type.int; + <parameter>$proxy_port</parameter> + </term> + <listitem> + <para> + a port for connecting to the remote server. + Defaults to 8080 for http:// connections and + 443 for https:// and ssl:// connections. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + &type.string; + <parameter>$proxy_user</parameter> + </term> + <listitem> + <para> + a user name for accessing the proxy server + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + &type.string; + <parameter>$proxy_pass</parameter> + </term> + <listitem> + <para> + a password for accessing the proxy server + </para> + </listitem> + </varlistentry> + + </variablelist> + </para> + + <note> + <para> + In order to use SSL connections, your PHP installation must + have the <ulink url="http://php.net/openssl"> + <literal>openssl</literal></ulink> extension enabled. + </para> + </note> + + <para> Here's an example client set up to query Userland's XML-RPC server at <emphasis>betty.userland.com</emphasis>: </para> <programlisting role="php"> <![CDATA[ -$client = new XML_RPC_Client("/RPC2", "betty.userland.com", 80); +$client = new XML_RPC_Client('/RPC2', 'betty.userland.com'); ]]> </programlisting> - - <note> - <para> - The <parameter>server_port</parameter> parameter is optional, and if - omitted will default to 80 when using HTTP and 443 when using HTTPS - (see the "send" method below.) - </para> - </note> </refsect2> <refsect2> @@ -65,8 +184,7 @@ <funcprototype> <funcdef>$response = $client->send</funcdef> <paramdef><parameter>$xmlrpc_message</parameter></paramdef> - <paramdef><parameter>$timeout</parameter></paramdef> - <paramdef><parameter>$server_method</parameter></paramdef> + <paramdef><parameter><optional>$timeout</optional></parameter></paramdef> </funcprototype> </funcsynopsis> @@ -85,23 +203,6 @@ </para> <para> - The <parameter>server_method</parameter> parameter is optional, and - if omitted will default to 'http'. The only other valid value is - 'https', which will use an SSL HTTP connection to connect to the - remote server. Note that your PHP must have the "curl" extensions - compiled in in order to use this feature. Note that when using SSL - you should normally set your port number to 443, unless the SSL - server you are contacting runs at any other port. - </para> - - <warning> - <para> - PHP 4.0.2 or greater is required for SSL functionality. PHP 4.0.6 - has a bug which prevents SSL working. - </para> - </warning> - - <para> If the value of <parameter>$response</parameter> is <literal>0</literal> rather than an <classname>XML_RPC_Response</classname> object, then this signifies @@ -150,9 +251,7 @@ <para> This method sets the optional certificate and passphrase used in - SSL-enabled communication with a remote server (when the - <parameter>server_method</parameter> is set to 'https' in the - client's construction). + SSL-enabled communication with a remote server. </para> <para> @@ -163,8 +262,8 @@ </para> <para> - This requires the "curl" extensions to be compiled into your - installation of PHP. + This requires the <literal>openssl</literal> extensions to be + compiled into your installation of PHP. </para> </refsect3> @@ -523,8 +622,17 @@ </para> <para> The <classname>XML_RPC_Value</classname> class can store arbitrarily - complicated values using the following types: <literal>i4 int boolean - string double dateTime.iso8601 base64 array struct</literal>. You + complicated values using the following types: + <literal>i4</literal>, + <literal>int</literal>, + <literal>boolean</literal>, + <literal>string</literal>, + <literal>double</literal>, + <literal>dateTime.iso8601</literal>, + <literal>base64</literal>, + <literal>array</literal> or + <literal>struct</literal>. + You should refer to the <ulink url="&url.xmlrpc.spec;">spec</ulink> for more information on what each of these types mean. </para> @@ -546,7 +654,7 @@ <title>base64</title> <para> Base 64 encoding is performed transparently to the caller when - using this type. Therefore you ought to consider it as a "binary" + using this type. Therefore you ought to consider it as a binary data type, for use when you want to pass none 7-bit clean data. Decoding is also transparent. </para> @@ -564,18 +672,26 @@ <refsect3> <title>string</title> <para> - The characters <literal>&lt; &gt; &quot;</literal> and - <literal>&amp;</literal> are converted to their entity equivalents - <literal>&amp;lt; &amp;gt; &amp;quot;</literal> and - <literal>&amp;amp;</literal> for transport through XML-RPC. The - current XML-RPC spec recommends only encoding <literal>&lt; - &amp;</literal> but this implementation goes further, for reasons + The characters + <literal>&lt;</literal>, + <literal>&gt;</literal>, + <literal>&quot;</literal> and + <literal>&amp;</literal> + are converted to their entity equivalents + <literal>&amp;lt;</literal>, + <literal>&amp;gt;</literal>, + <literal>&amp;quot;</literal> and + <literal>&amp;amp;</literal> + for transport through XML-RPC. The + current XML-RPC spec recommends only encoding + <literal>&lt;</literal> and <literal>&amp;</literal> + but this implementation goes further, for reasons explained by <ulink url="&url.w3.xml.rec;">the XML 1.0 recommendation</ulink>. </para> <para> - TODO: <literal> &amp;apos;</literal> entity not yet supported + TODO: <literal>&amp;apos;</literal> entity is not yet supported </para> </refsect3> @@ -601,12 +717,12 @@ <funcprototype> <funcdef>$myVal = new XML_RPC_Value</funcdef> <paramdef><parameter>$scalarVal</parameter></paramdef> - <paramdef><parameter>"int" | "boolean" | "string" | "double" | "dateTime.iso8601" | "base64"</parameter></paramdef> + <paramdef><parameter>&apos;int&apos; | &apos;boolean&apos; | &apos;string&apos; | &apos;double&apos; | &apos;dateTime.iso8601&apos; | &apos;base64&apos;</parameter></paramdef> </funcprototype> <funcprototype> <funcdef>$myVal = new XML_RPC_Value</funcdef> <paramdef><parameter>$arrayVal</parameter></paramdef> - <paramdef><parameter>"array" | "struct"</parameter></paramdef> + <paramdef><parameter>&apos;array&apos; | &apos;struct&apos;</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -667,7 +783,7 @@ <funcprototype> <funcdef>$ok = $val->addScalar</funcdef> <paramdef><parameter>$scalarVal</parameter></paramdef> - <paramdef><parameter>"int" | "boolean" | "string" | "double" | "dateTime.iso8601" | "base64"</parameter></paramdef> + <paramdef><parameter>&apos;int&apos; | &apos;boolean&apos; | &apos;string&apos; | &apos;double&apos; | &apos;dateTime.iso8601&apos; | &apos;base64&apos;</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -729,8 +845,8 @@ </funcprototype> </funcsynopsis> <para> - Returns a string containing "struct", "array" or "scalar" - describing the base type of the value. If it returns "undef" it + Returns a string containing <literal>struct</literal>, <literal>array</literal> or <literal>scalar</literal> + describing the base type of the value. If it returns <literal>undef</literal> it means that the value hasn't been initialised. </para> </refsect3> @@ -867,11 +983,13 @@ </para> <programlisting role="php"> +<![CDATA[ function foo ($params) { ... } $s = new XML_RPC_Server(array("examples.myFunc" => array("function" => "foo"))); +]]> </programlisting> <para> @@ -888,6 +1006,7 @@ </para> <programlisting role="php"> +<![CDATA[ function foo ($params) { global $XML_RPC_erruser; // import user errcode value @@ -901,6 +1020,7 @@ return new XML_RPC_Response(new XML_RPC_Value("All's fine!", "string")); } } +]]> </programlisting> <refsect2> @@ -957,10 +1077,19 @@ <para> Within a server's dispatch map, each method has an array of possible signatures. Each signature is an array of types. The first entry is - the return type. For instance, the method <programlisting role="php"> - string examples.getStateName(int)</programlisting> has the signature - <programlisting role="php">array($xmlrpcString, - $xmlrpcInt)</programlisting> and, assuming that it the only possible + the return type. For instance, the method + <programlisting role="php"> +<![CDATA[ +string examples.getStateName(int) +]]> + </programlisting> + has the signature + <programlisting role="php"> +<![CDATA[ +array($xmlrpcString, $xmlrpcInt) +]]> + </programlisting> + and, assuming that it the only possible signature for the method, might be used like this in server creation: </para>
« previous php.pear.doc (#5668) next »