我正在尝试使用如下所示的示例请求从 PHP 向 SOAP Web 服务进行 Web 服务调用:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.somedomain.com/">
<soapenv:Header/>
<soapenv:Body>
<ws:SearchMarketplaceSku>
<ws:Request>
<ws:Security>
<ws:PartnerKey>[suppressed]</ws:PartnerKey>
<ws:Password>[suppressed]</ws:Password>
</ws:Security>
<ws:AvailableOnDate>2012-04-03T00:00:00</ws:AvailableOnDate>
<ws:IncludeStateDetails>true</ws:IncludeStateDetails>
<ws:State>CA</ws:State>
</ws:Request>
</ws:SearchMarketplaceSku>
</soapenv:Body>
</soapenv:Envelope>
正在使用的 PHP 代码是:
$soapClient = new SoapClient($wsdlUrl);
$ap_param = array('PartnerKey' => $PartnerKey, 'Password' => $metapackPassword, 'AvailableOnDate' => '2012-04-03T00:00:00','IncludeStateDetails'=>true, 'State'=>'CA');
$info = $soapClient->__call("SearchMarketplaceSku", $ap_param);
Web 服务调用导致“请求未正确指定;服务器无法反序列化请求”错误?问题是什么?$ap_param 数组是否需要包含所有与 XML 对应的嵌套节点?有没有更简单的方法可以使用“WSDL”模式进行此调用?
谢谢你的帮助