SoapClient getFunctions如何使用提供的输出

时间:2015-10-05 09:41:36

标签: php soap

我是SoapClient的新用户,现在我正在使用以下代码发出肥皂请求:

$client = new SoapClient("http://example.com/webservices/venues.asmx?wsdl", array("trace" => 1, "exception" => 0));

然后我调用SoapClient __getFunctions函数并打印出数据。以下是我得到的回复:

GetVenueResponse GetVenue(GetVenueRequest $getVenueRequest)

但是,如何使用此输出进行soap客户端调用以获取传递数据的响应,例如id为" test123"?

此外,如果我执行__getTypes(),我会得到以下输出:

[0]=>
  string(43) "struct GetVenueRequest {
 string VenueId;
}"

修改 我试图从上面的数据中做到以下几点:

class GetVenueRequest {
  function GetVenueRequest($id) 
  {
      $this->VenueId = $id;
  }
}
$getVenueRequest = new GetVenueRequest("TEST123");
$params = array(
   "GetVenueRequest" => $getVenueRequest,
 );

$response = $client->__soapCall("GetVenue", array($params));

但我最终得到以下错误消息:

Server was unable to process request. ---> Exception of type 'System.Exception' was thrown.

0 个答案:

没有答案