1. What is XML-RPC?
XML-RPC is a format designed by Userland Software company: it is a format designed to use HTTP protocol transfers XML format file to obtain remote procedure call (Remote Procedure Call) transmission method. The official website is www.xmlrpc.com.
There is a PHP XML-RPCFramework(Collection of classes) is used to use PHP Language to write XML-RPC client and server. The current stable release version is 2.2, and the download address of is http://sourceforge.net/projects/phpxmlrpc/files/phpxmlrpc/2.2.2/xmlrpc -2.2.2.tar.gz/download. In addition, you can also find other s language
XML-RPCwww.xmlrpc.com 🎜> list, such as Perl, Python. This article will introduce the use of XML-RPC for PHP
class library. 2. System Operation Requirements
The design goals of this class library are scalability and backward compatibility. Therefore, it supports most existing PHP
versions. The minimum required PHP version is 4.2. This library provides a compatibility layer to support PHP 4.0.5 and 4.1. Of course, the official recommendation is to use PHP 5.0 or higher. Note that if you want to use SSL or HTTP 1.1 to communicate with the remote server, you must put "CURL” extension is compiled into PHP. In addition, the native "xmlrpc" extension that comes with PHP is introduced here The XML-RPC class library is not the same thing, so there is no need to compile it into PHP. 3. Introduction to related classes 1.xmlrpcval There are six basic types in XML-RPC Two composite types, the basic types are: int, boolean, string , double, dateTime.iso8601, base6, the composite type is: array, struct. The function of Xmlrpcval is to convert the types in PHP into these types and put them into XML-RPC for transmission. Related methods: scalarVal():如果$val->kindOf()=="scalar",则直接返回改对象的PHP对应的值。 2.xmlrpcmsg 相关函数: 相关方法: 相关方法: 四,一个实际例子 在服务度的interface.php中: 在客户端的client.php中: 敢死队2在线观看<span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">123</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">int</span><span style="color: #000000;">"</span><span style="color: #000000;">); </span><span style="color: #008000;">//</span><span style="color: #008000;">将123作为XML-RPC int类型</span><span style="color: #008000;"><br/></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">123</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">string</span><span style="color: #000000;">"</span><span style="color: #000000;">); </span><span style="color: #008000;">//</span><span style="color: #008000;">将123作为XML-RPC string类型</span><span style="color: #008000;"><br/></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">123</span><span style="color: #000000;">);</span><span style="color: #008000;">//</span><span style="color: #008000;">如果没有第二个参数,系统默认将其作为string类型</span><span style="color: #008000;"><br/></span><span style="color: #000000;"><br/></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval( </span><span style="color: #008000;">//</span><span style="color: #008000;">XML-RPC array类型 </span><span style="color: #008000;"><br/></span><span style="color: #0000ff;">array</span><span style="color: #000000;">(<br/> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">"</span><span style="color: #000000;">string1</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"> <br/> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">"</span><span style="color: #000000;">string2</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">"</span><span style="color: #000000;">string3</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">array</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br/> <br/></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval( </span><span style="color: #008000;">//</span><span style="color: #008000;">XML-RPC struct类型 </span><span style="color: #008000;"><br/></span><span style="color: #0000ff;">array</span><span style="color: #000000;">( </span><span style="color: #000000;">"</span><span style="color: #000000;">name</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">"</span><span style="color: #000000;">codebean</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">string</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/> </span><span style="color: #000000;">"</span><span style="color: #000000;">age</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">34</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">int</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/> </span><span style="color: #000000;">"</span><span style="color: #000000;">address</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval( <br/> </span><span style="color: #0000ff;">array</span><span style="color: #000000;">( </span><span style="color: #000000;">"</span><span style="color: #000000;">street</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcva(</span><span style="color: #000000;">"</span><span style="color: #000000;">xiaoyinxilu</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">string</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">city</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">"</span><span style="color: #000000;">beijing</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">string</span><span style="color: #000000;">"</span><span style="color: #000000;">) )</span><span style="color: #000000;">,</span><span style="color: #000000;"> <br/> </span><span style="color: #000000;">"</span><span style="color: #000000;">struct</span><span style="color: #000000;">"</span><span style="color: #000000;">))</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/></span><span style="color: #000000;">"</span><span style="color: #000000;">struct</span><span style="color: #000000;">"</span><span style="color: #000000;">);</span>
kindOf(): Returns the basic type of the object: "struct", "array", "scalar".
arrayMen(int $n):如果$val->kindOf()=="array",返回$val中第n个的值。
arraySize():如果$val->kindOf()=="array",返回$val的元素个数。
这个类提供一个向XML-RPC服务器发送请求的对象,客户端发送xmlrpcmsg到服务器,服务器返回一个xmlrpcresp。<span style="color: #008000;">//</span><span style="color: #008000;">请求服务器的examples.getStateName方法,参数是123</span><span style="color: #008000;"><br/></span><span style="color: #800080;">$message</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcmsg(</span><span style="color: #000000;">"</span><span style="color: #000000;">examples.getStateName</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #0000ff;">array</span><span style="color: #000000;">(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">123</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">int</span><span style="color: #000000;">"</span><span style="color: #000000;">)));</span>
getNumParams():获取xmlrpcmsg对象的参数的总数。
getParam(int $n):获取xmlrpcmsg对象的第n个数的值。
3.xmlrpc_client
客户端的基本类。<span style="color: #008000;">//</span><span style="color: #008000;">在服务端www.test.com上面的interface.php路径建立相关链接。 </span><span style="color: #008000;"><br/></span><span style="color: #800080;">$client</span><span style="color: #000000;">=</span><span style="color: #000000;"> nw xmlrpc_client(</span><span style="color: #000000;">"</span><span style="color: #000000;">/interface.php</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">ww.test.com</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">80</span><span style="color: #000000;">);</span>
send($message,30):向服务端发送$message,超时时间是30秒。
setDebug(int $level):设置是否输出调试信息,默认是0即不输出调试信息。$level是1,打印服务端的HTTP头信息及XML信息。$level是2,同时打印服务端和客户端的HTTP头信息及XML信息。
4.xmlrpcresp
该类主要包含XML-RPC请求返回的结果。Xmlrpc_client的send方法返回该类型。<span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcresp(xmlrpcval </span><span style="color: #800080;">$val</span><span style="color: #000000;">);</span><span style="color: #008000;">//</span><span style="color: #008000;">在服务端生成一个xmlrpcresp对象</span><span style="color: #008000;"><br/></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcresp(</span><span style="color: #000000;">0</span><span style="color: #000000;">,</span><span style="color: #000000;">int </span><span style="color: #800080;">$errcode</span><span style="color: #000000;">,</span><span style="color: #0000ff;">string</span><span style="color: #800080;">$err_string</span><span style="color: #000000;">);</span><span style="color: #008000;">//</span><span style="color: #008000;">服务端出错时,可以返回该类型。</span>
faultCode():客户端获取服务端返回的出错代码。
faultString():客户端获取服务端返回的出错信息。
Value():客户端获取服务端返回的值。
5.xmlrpc_server
服务端的基本类。<span style="color: #0000ff;">function</span><span style="color: #000000;"> test(</span><span style="color: #800080;">$xmlrpcval</span><span style="color: #000000;">){<br/> </span><span style="color: #0000ff;">return</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcresp(</span><span style="color: #800080;">$val</span><span style="color: #000000;">);<br/>}<br/><br/></span><span style="color: #008000;">//</span><span style="color: #008000;">客户端可以访问examples.myTest来实际访问test()函数 </span><span style="color: #008000;"><br/></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpc_server( <br/> </span><span style="color: #0000ff;">array</span><span style="color: #000000;">( <br/> </span><span style="color: #000000;">"</span><span style="color: #000000;">examples.myTest</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #0000ff;">array</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">function</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #000000;">"</span><span style="color: #000000;">test</span><span style="color: #000000;">"</span><span style="color: #000000;">) <br/>));</span>
假设服务度是my.rpcserver.com,提供服务的路径是interface.php,客户端是my.test.com.<span style="color: #000000;"><?</span><span style="color: #000000;">php<br/></span><span style="color: #0000ff;">include</span><span style="color: #000000;">'</span><span style="color: #000000;">./lib/xmlrpc.inc</span><span style="color: #000000;">'</span><span style="color: #000000;">;<br/></span><span style="color: #0000ff;">include</span><span style="color: #000000;">'</span><span style="color: #000000;">./lib/xmlrpcs.inc</span><span style="color: #000000;">'</span><span style="color: #000000;">;<br/><br/></span><span style="color: #0000ff;">function</span><span style="color: #000000;"> foo(</span><span style="color: #800080;">$xmlrpcmsg</span><span style="color: #000000;">){<br/> </span><span style="color: #800080;">$par1</span><span style="color: #000000;">=</span><span style="color: #800080;">$xmlrpcmsg</span><span style="color: #000000;">-></span><span style="color: #000000;">getParam(</span><span style="color: #000000;">0</span><span style="color: #000000;">); </span><span style="color: #008000;">//</span><span style="color: #008000;">获取第一个参数</span><span style="color: #008000;"><br/></span><span style="color: #800080;">$val1</span><span style="color: #000000;">=</span><span style="color: #800080;">$par1</span><span style="color: #000000;">-></span><span style="color: #000000;">scalarval(); </span><span style="color: #008000;">//</span><span style="color: #008000;">转换成PHP对应的值</span><span style="color: #008000;"><br/></span><span style="color: #000000;"> <br/> </span><span style="color: #800080;">$par2</span><span style="color: #000000;">=</span><span style="color: #800080;">$xmlrpcmsg</span><span style="color: #000000;">-></span><span style="color: #000000;">getParam(</span><span style="color: #000000;">1</span><span style="color: #000000;">); </span><span style="color: #008000;">//</span><span style="color: #008000;">获取第二个参数</span><span style="color: #008000;"><br/></span><span style="color: #800080;">$val2</span><span style="color: #000000;">=</span><span style="color: #800080;">$par2</span><span style="color: #000000;">-></span><span style="color: #000000;">scalarval(); </span><span style="color: #008000;">//</span><span style="color: #008000;">转换成PHP对应的值</span><span style="color: #008000;"><br/></span><span style="color: #000000;"> <br/> </span><span style="color: #800080;">$par3</span><span style="color: #000000;">=</span><span style="color: #800080;">$xmlrpcmsg</span><span style="color: #000000;">-></span><span style="color: #000000;">getParam(</span><span style="color: #000000;">2</span><span style="color: #000000;">); </span><span style="color: #008000;">//</span><span style="color: #008000;">获取第二个参数<br/><br/> //转换成PHP对应的值</span><span style="color: #008000;"><br/></span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #800080;">$i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">; </span><span style="color: #800080;">$i</span><span style="color: #000000;"><</span><span style="color: #800080;">$par3</span><span style="color: #000000;">-></span><span style="color: #000000;">arraySize(); </span><span style="color: #800080;">$i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br/> </span><span style="color: #800080;">$v</span><span style="color: #000000;">=</span><span style="color: #800080;">$par3</span><span style="color: #000000;">-></span><span style="color: #000000;">arrayMem(</span><span style="color: #800080;">$i</span><span style="color: #000000;">);<br/> </span><span style="color: #800080;">$val</span><span style="color: #000000;">[] </span><span style="color: #000000;">=</span><span style="color: #800080;">$v</span><span style="color: #000000;">-></span><span style="color: #000000;">scalarVal()</span><span style="color: #000000;">.</span><span style="color: #000000;">"</span><span style="color: #000000;"><br/></span><span style="color: #000000;">"</span><span style="color: #000000;">;<br/> }<br/> <br/> </span><span style="color: #800080;">$msg1</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #008080;">strrev</span><span style="color: #000000;">(</span><span style="color: #800080;">$val1</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">string</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br/> </span><span style="color: #800080;">$msg2</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #008080;">strrev</span><span style="color: #000000;">(</span><span style="color: #800080;">$val2</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">int</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br/><br/> </span><span style="color: #800080;">$msg</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #0000ff;">array</span><span style="color: #000000;">(</span><span style="color: #800080;">$msg1</span><span style="color: #000000;">,</span><span style="color: #800080;">$msg2</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">array</span><span style="color: #000000;">"</span><span style="color: #000000;">); </span><span style="color: #008000;">//</span><span style="color: #008000;">返回一个array</span><span style="color: #008000;"><br/></span><span style="color: #000000;"> <br/> </span><span style="color: #0000ff;">return</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcresp(</span><span style="color: #800080;">$msg</span><span style="color: #000000;">);<br/>}<br/><br/></span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpc_server(<br/> </span><span style="color: #0000ff;">array</span><span style="color: #000000;">(<br/> </span><span style="color: #000000;">"</span><span style="color: #000000;">example.test</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #0000ff;">array</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">function</span><span style="color: #000000;">"</span><span style="color: #000000;">=></span><span style="color: #000000;">"</span><span style="color: #000000;">foo</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/> )<br/>);<br/></span><span style="color: #000000;">?></span>
<span style="color: #000000;"><?</span><span style="color: #000000;">php <br/></span><span style="color: #0000ff;">include</span><span style="color: #000000;">'</span><span style="color: #000000;">./lib/xmlrpc.inc</span><span style="color: #000000;">'</span><span style="color: #000000;">;<br/></span><span style="color: #800080;">$params</span><span style="color: #000000;">=</span><span style="color: #0000ff;">array</span><span style="color: #000000;">(<br/> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">"</span><span style="color: #000000;">hello rpc</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">string</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">123</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">int</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval( <br/> </span><span style="color: #0000ff;">array</span><span style="color: #000000;">(<br/> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">"</span><span style="color: #000000;">test</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">string</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcval(</span><span style="color: #000000;">456</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">int</span><span style="color: #000000;">"</span><span style="color: #000000;">)<br/> )</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/> </span><span style="color: #000000;">"</span><span style="color: #000000;">array</span><span style="color: #000000;">"</span><span style="color: #000000;">)</span><span style="color: #000000;">,</span><span style="color: #000000;"><br/>);<br/><br/></span><span style="color: #800080;">$message</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpcmsg(</span><span style="color: #000000;">"</span><span style="color: #000000;">example.test</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #800080;">$params</span><span style="color: #000000;">);<br/></span><span style="color: #800080;">$client</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> xmlrpc_client(</span><span style="color: #000000;">"</span><span style="color: #000000;">/interface.php</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">my.rpcserver.com</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">80</span><span style="color: #000000;">'</span><span style="color: #000000;">);<br/></span><span style="color: #008000;">//</span><span style="color: #008000;">$client->setDebug(2);</span><span style="color: #008000;"><br/></span><span style="color: #800080;">$res</span><span style="color: #000000;">=</span><span style="color: #800080;">$client</span><span style="color: #000000;">-></span><span style="color: #000000;">send(</span><span style="color: #800080;">$message</span><span style="color: #000000;">,</span><span style="color: #000000;">30</span><span style="color: #000000;">);<br/><br/></span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!</span><span style="color: #800080;">$res</span><span style="color: #000000;">-></span><span style="color: #000000;">faultCode()){<br/> </span><span style="color: #800080;">$v</span><span style="color: #000000;">=</span><span style="color: #800080;">$res</span><span style="color: #000000;">-></span><span style="color: #000000;">value();<br/> </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #800080;">$i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">; </span><span style="color: #800080;">$i</span><span style="color: #000000;"><</span><span style="color: #800080;">$v</span><span style="color: #000000;">-></span><span style="color: #000000;">arraySize(); </span><span style="color: #800080;">$i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br/> </span><span style="color: #800080;">$vv</span><span style="color: #000000;">=</span><span style="color: #800080;">$v</span><span style="color: #000000;">-></span><span style="color: #000000;">arrayMem(</span><span style="color: #800080;">$i</span><span style="color: #000000;">);<br/> </span><span style="color: #0000ff;">echo</span><span style="color: #800080;">$vv</span><span style="color: #000000;">-></span><span style="color: #000000;">scalarVal()</span><span style="color: #000000;">.</span><span style="color: #000000;">"</span><span style="color: #000000;"><br/></span><span style="color: #000000;">"</span><span style="color: #000000;">;<br/> }<br/>}</span><span style="color: #0000ff;">else</span><span style="color: #000000;">{<br/> </span><span style="color: #0000ff;">echo</span><span style="color: #800080;">$res</span><span style="color: #000000;">-></span><span style="color: #000000;">faultcode()</span><span style="color: #000000;">.</span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">"</span><span style="color: #000000;">.</span><span style="color: #800080;">$res</span><span style="color: #000000;">-></span><span style="color: #000000;">faultString()</span><span style="color: #000000;">.</span><span style="color: #000000;">"</span><span style="color: #000000;"><br/></span><span style="color: #000000;">"</span><span style="color: #000000;">;<br/>}<br/></span><span style="color: #000000;">?></span>