Php 将头身份验证信息传递给WSDL
我的SOAP WSDL请求如下所示:Php 将头身份验证信息传递给WSDL,php,web-services,soap,nusoap,soap-client,Php,Web Services,Soap,Nusoap,Soap Client,我的SOAP WSDL请求如下所示: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body><unit>3452</unit> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body><unit>3452</unit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我的SOAP身份验证参数被发送到服务器,但它并没有显示在SOAP请求文本中。我需要看到他们的请求消息
我需要在WSDL文件中添加哪些类型的代码才能获得请求文本,如下所示
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<Login>BonZ</Login>
<Password>xxxx</Password>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<unit>3452</unit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
邦兹
xxxx
3452
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<Login>BonZ</Login>
<Password>xxxx</Password>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<unit>3452</unit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
$CREDENTIALS = 'Login:Password';
$auth = base64_encode($CREDENTIALS);
$context = array('http' =>
array(
'header' => "Authorization: Basic ".$auth
)
);
$trac["stream_context"]=stream_context_create($context);
$client = new SoapClient("call.wsdl",array(
"trace" => 1,
"exceptions" => 0,
"login" => 'xxxxx',
"password" => 'xxxx'
"stream_context"=>stream_context_create($context)
));