xmlrpc_call
Table of Contents
xmlrpc calls
command line
<?xml version="1.0" encoding="utf-8"?>
<methodCall>
<methodName>groups.getGroupMembers</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>GroupID</name>
<value>
<string>12345</string>
</value>
</member>
<member>
<name>RequestingAgentID</name>
<value>
<string>12345</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
curl -i -d @myfile.xml -X POST -w '%{http_code}\n' http://server
php
$request = xmlrpc_encode_request("groups.getGroupMembers", array(
"GroupID" => "12345",
"RequestingAgentID" => "12345"
));
//create the stream context for the request
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml\r\nUser-Agent: PHPRPC/1.0\r\n",
'content' => $request
)));
//URL of the XMLRPC Server
$server = 'http://server';
$file = file_get_contents($server, false, $context);
//decode the XMLRPC response
$response = xmlrpc_decode($file);
//display the response
print_r($response);
xmlrpc_call.txt · Last modified: by 127.0.0.1
