xmlrpc.XMLRPCMethod
A class for creating a remote method.The method created can be invoked like any other function. All parameters passed will be converted to XML. The remote procedure will be called using the XML-RPC protocoll and the result will be converted to JavaScript objects and returned.
If the RPC returned an XML-RPC Fault then the Fault will be raised as an exception.
Asynchronous operation:
If the last parameter passed to the method is an XMLRPCAsyncCallback object, then the remote method will be called asynchronously. The results and errors are passed to the callback.
This is the preffered way for asynchronous operation. callAsync is deprecated and will be removed in future versions.
constructor
XMLRPCMethod(url, methodName, user=null, pass=null)
parameters:
parameters:
- url The URL of the service providing the method.
- methodName The name of the method to be invoked on the server side.
- user The user name for HTTP authentication.
- pass The password for HTTP authentication.
instance methods
- callAsync(..., callback)
This method will be removed in future versions of this module.
Calls the remote method asynchronously.
Use an XMLRPCAsyncCallback as a last parameter to the regular method invocation instead.
parameters:- ...
The parameters to pass to the remote method. - callback
An XMLRPCAsyncCallback function to call upon completion of the RPC.
- ...
- toMulticall(...)
Returns an object which can be used for XML-RPC system.multicall..
parameters:- ... The parameters to pass to the remote method.
A MulicallObject object which can be passed as parameter to XML-RPC system.multicall to make a multi call to the service.. - setAuthentication(user, pass)
Sets username and password for HTTP Authentication.
parameters:- user The username for HTTP authentication.
- pass The password for HTTP authentication.
instance properties
- methodName
The name of the remote method. - url
The url of the remote service containing the method. - user
The username for HTTP authentication. - pass
The password for HTTP authentication.
interfaces
- XMLRPCAsyncCallback(result, exception)
Will be called upon completion of the XML-RPC.
parameters:- result The result of the RPC or null if there was an error.
- exception Exception or Fault that occured when doing the RPC, or null if everything went fine.