<HTML ><HEAD ><TITLE >xmlrpcresp</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.64 "><LINK REV="MADE" HREF="edd@usefulinc.com"><LINK REL="HOME" TITLE="XML-RPC for PHP" HREF="index.html"><LINK REL="UP" TITLE="Class documentation" HREF="apidocs.html"><LINK REL="PREVIOUS" TITLE="xmlrpcmsg" HREF="xmlrpcmsg.html"><LINK REL="NEXT" TITLE="xmlrpcval" HREF="xmlrpcval.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >XML-RPC for PHP: version 1.0b9</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="xmlrpcmsg.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 5. Class documentation</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="xmlrpcval.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="XMLRPCRESP" >xmlrpcresp</A ></H1 ><P >This class is used to contain responses to XML-RPC requests. A server method handler will construct an <TT CLASS="CLASSNAME" >xmlrpcresp</TT > and pass it as a return value. This same value will be returned by the result of an invocation of the <TT CLASS="FUNCTION" >send</TT > method of the <TT CLASS="CLASSNAME" >xmlrpc_client</TT > class.</P ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN335" >Creation</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><A NAME="AEN337" ></A ><P ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >$resp=new xmlrpcresp</CODE >($xmlrpcval);</CODE ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >$resp=new xmlrpcresp</CODE >(0, $errcode, $errstring);</CODE ></P ><P ></P ></DIV ><P >The first instance is used when execution has happened without difficulty: <TT CLASS="PARAMETER" ><I >$xmlrpcval</I ></TT > is an <TT CLASS="CLASSNAME" >xmlrpcval</TT > value with the result of the method execution contained in it.</P ><P > The second type of constructor is used in case of failure. <TT CLASS="PARAMETER" ><I >$errcode</I ></TT > and <TT CLASS="PARAMETER" ><I >$errstring</I ></TT > are used to provide indication of what has gone wrong. See <A HREF="xmlrpc-server.html" >xmlrpc_server</A > for more information on passing error codes. </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN357" >Methods</A ></H2 ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN359" >faultCode</A ></H3 ><DIV CLASS="FUNCSYNOPSIS" ><A NAME="AEN361" ></A ><P ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >$fn=$resp->faultCode</CODE >();</CODE ></P ><P ></P ></DIV ><P >Returns the integer fault code return from the XML-RPC response <TT CLASS="PARAMETER" ><I >$resp</I ></TT >. A zero value indicates success, any other value indicates a failure response.</P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN367" >faultString</A ></H3 ><DIV CLASS="FUNCSYNOPSIS" ><A NAME="AEN369" ></A ><P ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >$fs=$resp->faultString</CODE >();</CODE ></P ><P ></P ></DIV ><P > Returns the human readable explanation of the fault indicated by <TT CLASS="FUNCTION" >$resp->faultCode</TT >. </P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN375" >value</A ></H3 ><DIV CLASS="FUNCSYNOPSIS" ><A NAME="AEN377" ></A ><P ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >$xmlrpcVal=$resp->value</CODE >();</CODE ></P ><P ></P ></DIV ><P > Returns an <TT CLASS="CLASSNAME" >xmlrpcval</TT > object containing the return value sent by the server. If the response's <TT CLASS="FUNCTION" >faultCode</TT > is non-zero then the value returned by this method should not be used (it may not even be an object). </P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN384" >serialize</A ></H3 ><P ></P ><DIV CLASS="FUNCSYNOPSIS" ><A NAME="AEN387" ></A ><P ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >$outString=$resp->serialize</CODE >();</CODE ></P ><P ></P ></DIV ><P >Returns an XML string representation of the response.</P ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="xmlrpcmsg.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="xmlrpcval.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >xmlrpcmsg</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="apidocs.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >xmlrpcval</TD ></TR ></TABLE ></DIV ></BODY ></HTML >