soapclientphp中的头
我很少使用肥皂。如何在soap客户端中指定用户名和密码? 请参见下面WSDL的相应部分soapclientphp中的头,php,soap,Php,Soap,我很少使用肥皂。如何在soap客户端中指定用户名和密码? 请参见下面WSDL的相应部分 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xx="xx.services.soap"> <soapenv:Header> <cb:UserName>_SNIP_</cb:UserName> <cb:Password>_SN
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xx="xx.services.soap">
<soapenv:Header>
<cb:UserName>_SNIP_</cb:UserName>
<cb:Password>_SNIP_</cb:Password>
</soapenv:Header>
<soapenv:Body>
<cb:checkOrderable>
<arg2>
<EAN>9789084999820</EAN>
<DeliveryChannel>CBW</DeliveryChannel>
</arg2>
</cb:checkOrderable>
</soapenv:Body>
</soapenv:Envelope>
您应该使用
登录
和密码
参数进行基本身份验证。也值得添加'trace'=>true
。如果您的WSDL受密码保护,那么您需要将它们传递给SoapClient
构造函数。您是否查看了中的身份验证说明?我查看了javabrett。我尝试了所有的例子,没有结果。不可能没有结果-结果是什么-身份验证挑战,401。403? 服务支持什么身份验证,BASIC?我尝试过:$client=new-SoapClient(“=>”用户名“,”密码“=>”密码”);抱歉…结果:stdClass对象([Message]=>stdClass对象([MessageType]=>E[MessageCode]=>WMS-00005[MessageText]=>调用方未提供用户名和/或密码。)
$client = new SoapClient("https://xxxxx...xxxxxService?wsdl");
$params = array(
"UserName" => "abc",
"Password" => "def",
"EAN" => $ean,
"DeliveryChannel" => "xxx",
);
$response = $client->checkOrderable( $params );
print_r( $response );