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 !
Select the service task or web service integration component and click the Variables tab above the diagram area. Create the private variable that you will later map to the SOAP header of the request message. To add a single header entry to the request message, use the variable type SOAPHeader.
To make SOAP requests to the SOAP API endpoint, use the "Content-Type: application/soap+xml" request header, which tells the server that the request body contains a SOAP envelope. The server informs the client that it has returned a SOAP envelope with a "Content-Type: application/soap+xml" response header.
A PHP SOAP Extension can be used to provide and consume Web services. In other words, this PHP extension can be used by PHP developers to write their own Web Services, as well as to write clients to make use of the existing Web services.
The SOAP <Header> is an optional element in a SOAP message. It is used to pass application-related information that is to be processed by SOAP nodes along the message path. The immediate child elements of the <Header> element are called header blocks.
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With