0

SOAP サーバーを呼び出す必要があります。このような要求形式が提供されます (このページhttps://book.mylimobiz.com/api/ApiService.asmx?op=Testを参照してください) 。

POST /api/ApiService.asmx HTTP/1.1
Host: book.mylimobiz.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://book.mylimobiz.com/api/Test"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Test xmlns="https://book.mylimobiz.com/api">
      <apiId>string</apiId>
      <apiKey>string</apiKey>
    </Test>
  </soap:Body>
</soap:Envelope>

私はリクエストを送信するためにphp nusoapを使用しています。

require_once('lib/nusoap.php');

$serverPath = "https://book.mylimobiz.com/api/ApiService.asmx";
$param = array("apiId"=>"someapi","apiKey"=>"somekYE");
$client = new SoapClient($serverPath);

    $tt = $client->call("Test",$param,"https://book.mylimobiz.com/api","https://book.mylimobiz.com/api/Test");

これは機能していませんが、nusoap などを使用してリクエストする方法を教えてもらえますか。

ありがとう

4

1 に答える 1

0

あなたはこのようにそれを行うことができます:

 $client = new SoapClient('https://book.mylimobiz.com/api/ApiService.asmx?WSDL');
 $params = array();
 $params["apiId"] = apiId;
 $params["apiKey"] = apiKey;
 $result = $client->Test($params);   
于 2012-07-27T19:03:11.273 に答える