note 100042 added to soapclient.dorequest
| From: | psfere at hotmail dot com | Date: | Tue, 21 Sep 2010 16:52:14 +0000 |
| Subject: | note 100042 added to soapclient.dorequest | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172722@lists.php.net to get a copy of this message | ||
I was needing to add a blank soap header (<SOAP-ENV:Header /> and found no other place that
has done this. The only way I was able to support this was to extend SoapClient and re-define
__doRequest. Hope this helps someone or if there is support for this in the library, please point
me in the right direction:
class MySoapCli extends SoapClient {
function __doRequest($request, $location, $action, $version) {
$dom = new DomDocument('1.0', 'UTF-8');
$dom->preserveWhiteSpace = false;
$dom->loadXML($request);
$hdr = $dom->createElementNS('http://schemas.xmlsoap.org/soap/envelope/',
'SOAP-ENV:Header');
$dom->documentElement->insertBefore($hdr, $dom->documentElement->firstChild);
$request = $dom->saveXML();
return parent::__doRequest($request, $location, $action, $version);
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 66.195.97.121
----
Manual Page -- http://www.php.net/manual/en/soapclient.dorequest.php
Edit -- https://master.php.net/note/edit/100042
Del: integrated -- https://master.php.net/note/delete/100042/integrated
Del: useless -- https://master.php.net/note/delete/100042/useless
Del: bad code -- https://master.php.net/note/delete/100042/bad+code
Del: spam -- https://master.php.net/note/delete/100042/spam
Del: non-english -- https://master.php.net/note/delete/100042/non-english
Del: in docs -- https://master.php.net/note/delete/100042/in+docs
Del: other reasons-- https://master.php.net/note/delete/100042
Reject -- https://master.php.net/note/reject/100042
Search -- https://master.php.net/manage/user-notes.php