0

リモートIISサーバーのsomefile.ashxにメソッドがあります。呼び出そうとしているメソッドの1つは、「UserLogInReq」です。

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

somepage.ashxにあるWebサービスページに移動すると、このメソッドがすべてのメンバーとともに一覧表示されます。ただし、このスクリプトを実行すると、次のようになります。

Notice: unsupported method called: UserLogInReq (0)

私が見つけたすべてのヘルプは、一般的なxml-rpcフックアップ/呼び出しとは何の関係もありません。

これはWebサービスのアクセス許可の問題ですか?私は何が間違っているのですか?

ありがとう!

4

1 に答える 1

0

これは私の側の誤解に終わった。XML-RPC requriers構造体。これは、phpのネストされた配列に相当します。php配列でいくつかのレベルを下げる必要がありました。

于 2012-09-14T18:53:19.183 に答える