I have a method on a remote IIS server at somefile.ashx, one of the methods I’m trying to call is ‘UserLogInReq’.
UserLogInReq has the following members:
String: Username
String: Password
String: ClientType
This is my script so far:
$request = xmlrpc_encode_request('UserLogInReq', array("UserName" => '$username',"Password" =>'$password',"ClientType" => ''));
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml",
'content' => $request
)));
$file = file_get_contents("http://someserver/somepage.ashx", false, $context);
$response = xmlrpc_decode($file);
if ($response && xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
print_r($response);
}
When I navigate to my web-service page, at somepage.ashx, this method is listed, with all of those members. However, when I run this script, I am getting:
Notice: unsupported method called: UserLogInReq (0)
All the help I could find is somehow un-related to a generic xml-rpc hookup/call.
Is this a permissions problem with the web-service?
What am I doing wrong?
Thanks!
This ended up being a misunderstanding on my part. XML-RPC requriers structs, which equate to nested arrays in php. I just had to go down a few levels on the php arrays.