我想从我的Soap请求中删除ns:1和ns:2。 实际上是在生成时得到的:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="*********" xmlns:ns2="**************"><SOAP-ENV:Header><ns2:shp:sc><user>***</user><password>*******</password><companyName>******</companyName><autoCommit>***</autoCommit></ns2:shp:sc></SOAP-ENV:Header><SOAP-ENV:Body><ns1:p_put_order><put_orderRequest><shop_order>TEST2</shop_order><shop_account>100000</shop_account><order_comment>test</order_comment></put_orderRequest></ns1:p_put_order></SOAP-ENV:Body></SOAP-ENV:Envelope>
然后在我的php文件中,我得到了:
$options = array("soap_version" => SOAP_1_1,
"encoding" => "UTF-8",
"trace" => true,
"exceptions" => true,
'cache_wsdl' => WSDL_CACHE_NONE,
);
$client = new SoapClient($soapURL, $options);
$header = new SoapHeader($soapURL,'shp:sc',$auth, false);
$headerSoap = $client->__setSoapHeaders($header);
我尝试使用SoapVar(),__doRequest(),但这些都不起作用... 你有一个想法吗? 谢谢您的帮助
答案 0 :(得分:0)
$ header = new SoapHeader($ soapURL,'shp:sc',$ auth,false);
请从此处删除$ soapURL。假定第一个参数是名称空间。请在此处查看文档:{{3}}。如果失败,请发布WSDL文件。