2012-07-30 34 views
0

我在遠程IIS服務器上的somefile.ashx中有一個方法,我試圖調用的方法之一是'UserLogInReq'。xmlrpc不支持php的方法調用

UserLogInReq具有以下成員:

字符串:用戶名
字符串:密碼
字符串:ClientType

這是迄今爲止我的腳本:

$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); 
} 

當我瀏覽到我的web服務頁面,在somepage.ashx中,列出了此方法以及所有這些成員。然而,當我運行該腳本,我得到:

Notice: unsupported method called: UserLogInReq (0) 

所有幫助我能找到的是有點不相關的通用XML-RPC聯播/通話。

這是網絡服務的權限問題嗎? 我在做什麼錯?

謝謝!

回答

0

這最終成爲我的一個誤解。 XML-RPC requriers結構,它等同於php中的嵌套數組。我只需要在php數組上下幾個級別。