开发者

How to set this php soap header?

开发者 https://www.devze.com 2023-03-29 23:23 出处:网络
How do i set this php Soap Header ?? For the life of me I can\'t figure it out. <soapenv:Header>

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); 
0

精彩评论

暂无评论...
验证码 换一张
取 消