How do i set this php Soap Header ?? For the life of me I can't figure it out.
<soapenv:Header>
<wsse:HeaderOne soapenv:mustUnderstand="1">
<wsse:UsernameKey wsu:Id="tun-12345">
<wsse:Username>myusername</wsse:Username>
<wsse:Password>mypassword</wsse:Password>
</wsse:UsernameKey>
</wsse:HeaderOne>
</soapenv:Header>
Thanks 开发者_如何学运维guys !
See this comment:
http://www.php.net/manual/en/soapclient.setsoapheaders.php#93460
So it would be like:
$headerbody = array('UsernameKey'=>array('Username'=>$UserID,
'Password'=>$Pwd));
$header = new SoapHeader($ns, 'RequestorCredentials', $headerbody);
//set the Headers of Soap Client.
$soap_client->__setSoapHeaders($header);
精彩评论