[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 <title>.: jsolait :. | documentation | xmlrpc</title> 6 <link rel="stylesheet" type="text/css" href="./html.css" /> 7 <meta name="author" content="Jan-Klaas Kollhof" /> 8 <meta name="keywords" content="jsolait.xmlrpc" /> 9 </head> 10 <body> 11 <a name="top" id="top"></a> 12 <div class="navigationBar"><a href="./index.xhtml">documentation</a> | 13 xmlrpc</div> 14 <div class="menu"> 15 <ul></ul> 16 <div class="copyright">copyright © 2004, Jan-Klaas Kollhof</div> 17 </div> 18 <div class="content"> 19 <h1>Module xmlrpc</h1> 20 Provides an XML-RPC imlementation. 21 It is similar to python's xmlrpclib module. 22 23 <div class="contentItem"><h2>public members:<a class="bttop" href="#top">▲</a></h2><div> 24 25 <h3>InvalidServerResponse()</h3><div class="indent"> 26 Exception thrown if a server did not respond with response status 200 (OK).<br /> 27 </div> 28 <h3>MalformedXmlRpc()</h3><div class="indent"> 29 Exception thrown if an XML-RPC response is not well formed.<br /> 30 </div> 31 <h3>Fault()</h3><div class="indent"> 32 Exception thrown if the RPC response is a Fault. <br /> 33 <ul> 34 <li><b>Fault::faultCode</b> The fault code returned by the rpc call.</li> 35 <li><b>Fault::faultString</b> The fault string returned by the rpc call.</li> 36 </ul> 37 </div> 38 39 <br /> 40 <h3>marshall(obj)</h3><div class="indent"> 41 Marshalls an object to XML-RPC.(Converts an object into XML-RPC conforming xml.)<br /> 42 It just calls the toXmlRpc function of the objcect.<br /> 43 So, to customize serialization of objects one just needs to specify/override the toXmlRpc method 44 which should return an xml string conforming with XML-RPC spec.<br /> 45 <b>obj</b> The object to marshall<br /> 46 <b>returns</b> An xml representation of the object.<br /> 47 </div> 48 <h3>unmarshall(xml)</h3><div class="indent"> 49 Unmarshalls an XML document to a JavaScript object. (Converts xml to JavaScript object.)<br /> 50 It parses the xml source and creates a JavaScript object.<br /> 51 <b>xml</b> The xml document source to unmarshall.<br /> 52 <b>returns</b> The JavaScript object created from the XML.<br /> 53 </div> 54 <h3>unmarshallDoc(doc,xml)</h3><div class="indent"> 55 Unmarshalls an XML document to a JavaScript object like unmarshall but expects a DOM document as parameter.<br /> 56 It parses the xml source and creates a JavaScript object.<br /> 57 <b>doc</b> The xml document(DOM compatible) to unmarshall.<br /> 58 <b>returns</b> The JavaScript object created from the XML.<br /> 59 </div> 60 61 <br /> 62 63 <h3>ServiceProxy(url,methodNames,user,pass)</h3><div class="indent"> 64 Class for creating proxy objects which resemble the remote service.<br /> 65 Method calls to this proxy will result in calls to the remote service.<br /> 66 <br /> 67 The arguments are interpreted as shown in the examples:<br /> 68 <br /> 69 ServerProxy("url")<br /> 70 ServerProxy("url", ["methodName1",...])<br /> 71 ServerProxy("url", ["methodName1",...], "user", "pass")<br /> 72 ServerProxy("url", "user", "pass")<br /> 73 <ul> 74 <li><b>url</b> The url of the service.</li> 75 <li><b>methodNames</b> =[] Array of names of methods that can be called on the server.<br /> 76 If no methods are given then introspection is used to get the methodnames from the server.</li> 77 <li><b>user</b> =null The user name to use for HTTP authentication.</li> 78 <li><b>pass</b> =null The password to use for HTTP authentication.</li> 79 </ul> 80 81 The ServiceProxy objects expose all the methods of the remote service as XMLRPCMethod objects. 82 In addition the object also has the following methods and properties.<br /> 83 <ul> 84 <li><b>ServiceProxy::_addMethodNames(methodNames)</b><br /> 85 Adds new XMLRPCMethods to the proxy server which can then be invoked.<br /> 86 <b>methodNames</b> Array of names of methods that can be called on the server.<br /> 87 </li> 88 <li><b>ServiceProxy::_setAuthentication(user,pass)</b><br /> 89 Sets username and password for HTTP Authentication for all methods of this service.<br /> 90 <b>user</b> The user name.<br /> 91 <b>pass</b> The password.<br /> 92 </li> 93 <li><b>ServiceProxy::_introspect()</b><br /> 94 Initiate XML-RPC introspection to retrieve methodnames from the server<br /> 95 and add them to the server proxy.<br /> 96 </li> 97 <li><b>ServiceProxy::_url</b><br /> 98 The url of the service to resemble.<br /> 99 </li> 100 <li><b>ServiceProxy::_user</b><br /> 101 The user used for HTTP authentication.<br /> 102 </li> 103 <li><b>ServiceProxy::_password</b><br /> 104 The password used for HTTP authentication.<br /> 105 </li> 106 <li><b>ServiceProxy::_methods</b><br /> 107 All XMLRPCMethod objects the proxy can call.<br /> 108 </li> 109 </ul> 110 </div> 111 112 113 114 <h3>XMLRPCMethod(url, name, user, pass)</h3><div class="indent"> 115 Class for creating XML-RPC methods.<br /> 116 Calling the created method will result in an XML-RPC call to the service.<br /> 117 The return value of this call will be the return value of the RPC call.<br /> 118 RPC-Faults will be raised as Exceptions.<br /> 119 <br /> 120 <ul> 121 <li><b>url</b> The URL of the service providing the method.</li> 122 <li><b>name</b> The name of the method to invoke.</li> 123 <li><b>user</b> =null The user name to use for HTTP authentication.</li> 124 <li><b>pass</b> =null The password to use for HTTP authentication.</li> 125 </ul> 126 Asynchronous operation:<br /> 127 If the last parameter passed to the method is an XMLRPCAsyncCallback object, <br /> 128 then the remote method will be called asynchronously. <br /> 129 The results and errors are passed to the callback. <br /> 130 <br /> 131 <ul> 132 <li><b>XMLRPCMethod::toMulticall()</b><br /> 133 Returns the method representation for system.multicall.<br /> 134 All params will be passed to the remote method.<br /> 135 <b>returns</b> An object containing a member methodName and a member params(As required by system.multicall).<br /> 136 </li> 137 <li><b>XMLRPCMethod::setAuthentication(user,pass)</b><br /> 138 Sets username and password for HTTP Authentication.<br /> 139 <b>user</b> The user name.<br /> 140 <b>pass</b> The password.<br /> 141 </li> 142 <li><b>XMLRPCMethod::methodName</b><br /> 143 The name of the remote method.<br /> 144 </li> 145 <li><b>XMLRPCMethod::url</b><br /> 146 The url of the remote service containing the method.<br /> 147 </li> 148 <li><b>XMLRPCMethod::user</b><br /> 149 The user name used for HTTP authorization.<br /> 150 </li> 151 <li><b>XMLRPCMethod::password</b><br /> 152 The password used for HTTP authorization.<br /> 153 </li> 154 </ul> 155 </div> 156 157 <h3>XMLRPCAsyncCallback(result, err)</h3><div class="indent"> 158 The interface of a callback for asynchronous XML-RPC. 159 <ul> 160 <li><b>result</b> The result of the call (null if error)</li> 161 <li><b>err</b> The Fault if there was one returned otherwise null</li> 162 </ul> 163 164 </div> 165 166 </div></div> 167 168 <div class="contentItem"><h2>requirements:<a class="bttop" href="#top">▲</a></h2><div> 169 170 <h3><a href="./urllib.xhtml">urllib</a></h3><div class="indent"> is required for making the HTTP request to the remote service.</div> 171 <h3><a href="./xml.xhtml">xml</a></h3><div class="indent"> is required for parsing the responses from the service.</div> 172 </div></div> 173 </div> 174 </body> 175 </html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |