git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_SGD/tags/3.7.0.2_original@1 eb19766c-00d9-a042-a3a0-45cb8ec72764
3 lines
7.0 KiB
HTML
3 lines
7.0 KiB
HTML
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>4. xmlrpcresp</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="XML-RPC for PHP"><link rel="up" href="ch07.html" title="Chapter 7. Class documentation"><link rel="prev" href="ch07s03.html" title="3. xmlrpc_client"><link rel="next" href="ch07s05.html" title="5. xmlrpc_server"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4. xmlrpcresp</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07s03.html">Prev</a> </td><th width="60%" align="center">Chapter 7. Class documentation</th><td width="20%" align="right"> <a accesskey="n" href="ch07s05.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="xmlrpcresp"></a>4. xmlrpcresp</h2></div></div></div><p>This class is used to contain responses to XML-RPC requests. A server method handler will construct an <code class="classname">xmlrpcresp</code> and pass it as a return value. This same value will be returned by the result of an invocation of the <code class="function">send</code> method of the <code class="classname">xmlrpc_client</code> class.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2262"></a>4.1. Creation</h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">$resp = new xmlrpcresp(</code></td><td><var class="pdparam">$xmlrpcval</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code>xmlrpcval</code> </td><td><code><var class="pdparam">$xmlrpcval</var>;</code></td></tr></table><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">$resp = new xmlrpcresp(</code></td><td><var class="pdparam">0</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">$errcode</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">$err_string</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code></code> </td><td><code><var class="pdparam">0</var>;</code></td></tr><tr><td><code>int</code> </td><td><code><var class="pdparam">$errcode</var>;</code></td></tr><tr><td><code>string</code> </td><td><code><var class="pdparam">$err_string</var>;</code></td></tr></table></div><p>The first syntax is used when execution has happened without difficulty: <em class="parameter"><code>$xmlrpcval</code></em> is an <code class="classname">xmlrpcval</code> value with the result of the method execution contained in it. Alternatively it can be a string containing the xml serialization of the single xml-rpc value result of method execution.</p><p>The second type of constructor is used in case of failure. <em class="parameter"><code>errcode</code></em> and <em class="parameter"><code>err_string</code></em> are used to provide indication of what has gone wrong. See <a href="ch07s05.html">xmlrpc_server</a> for more information on passing error codes.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2308"></a>4.2. Methods</h3></div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2311"></a>4.2.1. faultCode</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">$fn = $resp->faultCode(</code></td><td><code>)</code>;</td><td> </td></tr></table></div><p>Returns the integer fault code return from the XML-RPC response. A zero value indicates success, any other value indicates a failure response.</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2321"></a>4.2.2. faultString</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">$fs = $resp->faultString(</code></td><td><code>)</code>;</td><td> </td></tr></table></div><p>Returns the human readable explanation of the fault indicated by <code class="function">$resp->faultCode</code>().</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2334"></a>4.2.3. value</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">$xmlrpcVal = $resp->value(</code></td><td><code>)</code>;</td><td> </td></tr></table></div><p>Returns an <code class="classname">xmlrpcval</code> object containing the return value sent by the server. If the response's <code class="function">faultCode</code> is non-zero then the value returned by this method should not be used (it may not even be an object).</p><p>Note: if the xmlrpcresp instance in question has been created by an <code class="classname">xmlrpc_client</code> object whose <code class="varname">return_type</code> was set to 'phpvals', then a plain php value will be returned instead of an <code class="classname">xmlrpcval</code> object. If the <code class="varname">return_type</code> was set to 'xml', an xml string will be returned (see the return_type var above for more details).</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2364"></a>4.2.4. serialize</h4></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">$outString = $resp->serialize(</code></td><td><code>)</code>;</td><td> </td></tr></table></div><p>Returns an XML string representation of the response (xml prologue not included).</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07s03.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="ch07s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3. xmlrpc_client </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5. xmlrpc_server</td></tr></table></div></body></html> |