note 107889 added to class.soapheader
| From: | john at jtresponse dot co dot uk | Date: | Tue, 13 Mar 2012 13:30:24 +0000 |
| Subject: | note 107889 added to class.soapheader | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186626@lists.php.net to get a copy of this message | ||
None of the examples really do it for me.
Note: you should NOT need to hard-code any XML.
Here is an example of creating a nested header and including a parameter.
$client = new SoapClient(WSDL,array());
$auth = array(
'UserName'=>'USERNAME',
'Password'=>'PASSWORD',
'SystemId'=>
array('_'=>'DATA','Param'=>'PARAM'),
);
$header = new SoapHeader('NAMESPACE','Auth',$auth,false);
$client->__setSoapHeaders($header);
Gives the following header XML:
<SOAP-ENV:Header>
<ns1:Auth>
<ns1:SystemId Param="PARAM">DATA</ns1:SystemId>
<ns1:UserName>USERNAME</ns1:UserName>
<ns1:Password>PASSWORD</ns1:Password>
</ns1:Auth>
</SOAP-ENV:Header>
----
Server IP: 69.147.83.197
Probable Submitter: 82.1.181.98
----
Manual Page -- http://www.php.net/manual/en/class.soapheader.php
Edit -- https://master.php.net/note/edit/107889
Del: integrated -- https://master.php.net/note/delete/107889/integrated
Del: useless -- https://master.php.net/note/delete/107889/useless
Del: bad code -- https://master.php.net/note/delete/107889/bad+code
Del: spam -- https://master.php.net/note/delete/107889/spam
Del: non-english -- https://master.php.net/note/delete/107889/non-english
Del: in docs -- https://master.php.net/note/delete/107889/in+docs
Del: other reasons-- https://master.php.net/note/delete/107889
Reject -- https://master.php.net/note/reject/107889
Search -- https://master.php.net/manage/user-notes.php