SimpleXMLRPC 介绍
Simple XMLRPC 是 一个 PHP 语言对 XML-RPC 协议的封装。
示例代码:
`<?PHP
require_once (‘simpleXMLRPcclient.class.PHP’);
$server_path = ‘/simplexmlrpc/index.PHP’;
$server_hostname = ‘localhost’;
$sendHTTPS = ;
$serverPort = NULL;
$xmlrpc = new SimpleXMLRPcclient ();
$xmlrpc->debug = ;
$xmlrpc->SetXMLRPCServer ($server_hostname, $server_path, $serverPort,
$sendHTTPS);
Array that we want to send
$arrayOfStructs = Array ( Array (‘curly’ => 3),
Array (‘curly’ => 2)
);
Create the XMLRPC message with the methodName
$xmlrpc->CreateXMLRP@R_404_6463@ssage (‘validator1.arrayOfStructsTest’);
Now we simply add the array we want to send with the message
$xmlrpc->AddArray ($arrayOfStructs);
And Now we send it and we get back an array
$array = $xmlrpc->SendXMLRPC ();
print out the returned array
print_r ($array);
?>`