3. xmlrpcresp

This class is used to contain responses to XML-RPC requests. A server method handler will construct an xmlrpcresp and pass it as a return value. This same value will be returned by the result of an invocation of the send method of the xmlrpc_client class.

3.1. Creation

$resp=new xmlrpcresp($xmlrpcval);
$xmlrpcval;

$resp=new xmlrpcresp(0, $errcode, $err string);
0;
$errcode;
$err string;

The first instance is used when execution has happened without difficulty: $xmlrpcval is an xmlrpcval value with the result of the method execution contained in it.

The second type of constructor is used in case of failure. $errcode and $err string are used to provide indication of what has gone wrong. See xmlrpc_server for more information on passing error codes.

3.2. Methods

3.2.1. faultCode

$fn=$resp->faultCode();
;

Returns the integer fault code return from the XML-RPC response $resp. A zero value indicates success, any other value indicates a failure response.

3.2.2. faultString

$fs=$resp->faultString();
;

Returns the human readable explanation of the fault indicated by $resp->faultCode.

3.2.3. value

$xmlrpcVal=$resp->value();
;

Returns an xmlrpcval object containing the return value sent by the server. If the response's faultCode is non-zero then the value returned by this method should not be used (it may not even be an object).

3.2.4. serialize

$outString=$resp->serialize();
;

Returns an XML string representation of the response.