xmlrpcCall()
Calls the function "function" on the server with the arguments of the parameter "args". If "result" is specified, the function waits for the answer from the server and saves the answer in "result". This corresponds to the call result = function(args[1], ...);
Synopsis
int xmlrpcCall(string id, string function, dyn_mixed args [,
mixed
result]);
Parameters
Parameter | Description |
---|---|
id | Id of the server |
function | The function that is called on the server. |
args | The argument with which the function on the server is called. |
result | The answer from the server is saved in this parameter. |
Return value
If an error occurs, -1 is returned. 0 means that the call could be sent successfully.
Description
Calls the function "function" on the server with the arguments of the parameter "args". If "result" is specified, the function waits for the answer from the server and saves the answer in "result". This corresponds to the call result = function(args[1], ...);
EXAMPLE
Connect to the server as follows, call the function on the server as well as close the connection to the server:
#uses "CtrlXmlRpc"
main()
{
string id = "servID";
string func = "wccoa.own.testmethod";
dyn_mixed args = makeDynString("World");;
mixed res;
string host = "localhost";
int port = "80";
bool secure = FALSE;
xmlrpcClient();
xmlrpcConnectToServer(id, host, port, secure);
xmlrpcCall(id, func, args, res);
DebugN("Result of XmlRpc call", res);
xmlrpcCloseServer(id);
}
Assignment
Availability
CTRL