mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
36 lines
9.6 KiB
HTML
36 lines
9.6 KiB
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>xmlrpcmsg</title><link rel="stylesheet" href="xmlrpc.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="index.html" title="XML-RPC for PHP" /><link rel="up" href="ch07.html" title="Chapter 7. Class documentation" /><link rel="prev" href="ch07.html" title="Chapter 7. Class documentation" /><link rel="next" href="ch07s03.html" title="xmlrpc_client" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">xmlrpcmsg</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07.html">Prev</a> </td><th width="60%" align="center">Chapter 7. Class documentation</th><td width="20%" align="right"> <a accesskey="n" href="ch07s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="xmlrpcmsg"></a>xmlrpcmsg</h2></div></div></div><p>This class provides a representation for a request to an XML-RPC
|
||
server. A client sends an <code class="classname">xmlrpcmsg</code> to a server,
|
||
and receives back an <code class="classname">xmlrpcresp</code> (see <a class="xref" href="ch07s03.html#xmlrpc-client-send" title="send">xmlrpc_client->send</a>).</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id934064"></a>Creation</h3></div></div></div><p>The constructor takes the following forms:</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">xmlrpcmsgnew
|
||
<b class="fsfunc">xmlrpcmsg</b>(</code></td><td>string<var class="pdparam">$methodName</var>, </td></tr><tr><td> </td><td>array<var class="pdparam">$parameterArray</var>null<code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Where <em class="parameter"><code>methodName</code></em> is a string indicating
|
||
the name of the method you wish to invoke, and
|
||
<em class="parameter"><code>parameterArray</code></em> is a simple php
|
||
<code class="classname">Array</code> of <code class="classname">xmlrpcval</code>
|
||
objects. Here's an example message to the <span class="emphasis"><em>US state
|
||
name</em></span> server:</p><pre class="programlisting"><code><span style="color: #000000">
|
||
<span style="color: #0000BB">$msg </span><span style="color: #007700">= new </span><span style="color: #0000BB">xmlrpcmsg</span><span style="color: #007700">(</span><span style="color: #DD0000">"examples.getStateName"</span><span style="color: #007700">, array(new </span><span style="color: #0000BB">xmlrpcval</span><span style="color: #007700">(</span><span style="color: #0000BB">23</span><span style="color: #007700">, </span><span style="color: #DD0000">"int"</span><span style="color: #007700">)));</span>
|
||
</span>
|
||
</code></pre><p>This example requests the name of state number 23. For more
|
||
information on <code class="classname">xmlrpcval</code> objects, see <a class="xref" href="ch07.html#xmlrpcval" title="xmlrpcval">xmlrpcval</a>.</p><p>Note that the <em class="parameter"><code>parameterArray</code></em> parameter is
|
||
optional and can be omitted for methods that take no input parameters
|
||
or if you plan to add parameters one by one.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id934152"></a>Methods</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id934158"></a>addParam</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">bool<b class="fsfunc">addParam</b>(</code></td><td>xmlrpcval<var class="pdparam">$xmlrpcVal</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Adds the <code class="classname">xmlrpcval</code>
|
||
<em class="parameter"><code>xmlrpcVal</code></em> to the parameter list for this
|
||
method call. Returns TRUE or FALSE on error.</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id934197"></a>getNumParams</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">int<b class="fsfunc">getNumParams</b>(</code></td><td><code>void)</code>;</td><td> </td></tr></table><div class="funcprototype-spacer"> </div></div><p>Returns the number of parameters attached to this
|
||
message.</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id934225"></a>getParam</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">xmlrpcval<b class="fsfunc">getParam</b>(</code></td><td>int<var class="pdparam">$n</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Gets the <em class="parameter"><code>n</code></em>th parameter in the message
|
||
(with the index zero-based). Use this method in server
|
||
implementations to retrieve the values sent by the client.</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id934261"></a>method</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">string<b class="fsfunc">method</b>(</code></td><td><code>void)</code>;</td><td> </td></tr></table><div class="funcprototype-spacer"> </div><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">string<b class="fsfunc">method</b>(</code></td><td>string<var class="pdparam">$methName</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Gets or sets the method contained in the XML-RPC
|
||
message.</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id934392"></a>parseResponse</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">xmlrpcresp<b class="fsfunc">parseResponse</b>(</code></td><td>string<var class="pdparam">$xmlString</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Given an incoming XML-RPC server response contained in the
|
||
string <em class="parameter"><code>$xmlString</code></em>, this method constructs an
|
||
<code class="classname">xmlrpcresp</code> response object and returns it,
|
||
setting error codes as appropriate (see <a class="xref" href="ch07s03.html#xmlrpc-client-send" title="send">xmlrpc_client->send</a>).</p><p>This method processes any HTTP/MIME headers it finds.</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id934438"></a>parseResponseFile</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">xmlrpcresp<b class="fsfunc">parseResponseFile</b>(</code></td><td>file handle
|
||
resource<var class="pdparam">$fileHandle</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><p>Given an incoming XML-RPC server response on the open file
|
||
handle <em class="parameter"><code>fileHandle</code></em>, this method reads all the
|
||
data it finds and passes it to
|
||
<code class="function">parseResponse.</code></p><p>This method is useful to construct responses from pre-prepared
|
||
files (see files <code class="literal">demo1.txt, demo2.txt, demo3.txt</code>
|
||
in this distribution). It processes any HTTP headers it finds, and
|
||
does not close the file handle.</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id934484"></a>serialize</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">string
|
||
<b class="fsfunc">serialize</b>(</code></td><td><code>void)</code>;</td><td> </td></tr></table><div class="funcprototype-spacer"> </div></div><p>Returns the an XML string representing the XML-RPC
|
||
message.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch07.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch07s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. Class documentation </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> xmlrpc_client</td></tr></table></div></body></html>
|