我尝试设置SOAP头是这样的:如何在PHP
<tns:Authentication xmlns:tns="iSklep3">
<ApiKey xsi:type="xsd:string">abc</ApiKey>
</tns:Authentication>
我做这样说:
//...
$client = new SoapClient($wsdlServer);
$headerBody = array("ApiKey" => "abc");
$header = new SoapHeader("iSklep3", "Authentication", $headerBody);
$client->__setSoapHeaders($header);
//...
//calling soap methods
...
当我打电话的方法,它返回API密钥错了,但它应该是对的。知道有人可能会遇到SOAP头问题吗?
我们可以看一看你调用类的任何方式? – Ryoku 2013-03-21 19:12:24
$ res = $ client-> getProductAvailableQuantity($ params); 它返回的Api键是错误的,但API键应该是正确的 – 2013-03-21 19:14:41
或你是什么意思?这是服务的外观http://services.w3.org/xslt?xslfile=http://tomi.vanek.sk/xml/wsdl-viewer.xsl&xmlfile=http://orderapi.beta.i-sklep.pl /soap/order?wsdl&transform=Submit#op.d1e540 – 2013-03-21 19:18:17