note 74123 added to function.soap-soapclient-dorequest
| From: | albert at jool dot nl | Date: | Mon, 26 Mar 2007 14:28:07 +0000 |
| Subject: | note 74123 added to function.soap-soapclient-dorequest | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124811@lists.php.net to get a copy of this message | ||
If you want to communicate with a default configured ASP.NET server with SOAP 1.1 support, override
your __doRequest with the following code. Adjust the namespace parameter, and all is good to go.
<?php
class MSSoapClient extends SoapClient {
function __doRequest($request, $location, $action, $version) {
$namespace = "http://tempuri.com";
$request = preg_replace('/<ns1:(\w+)/', '<$1
xmlns="'.$namespace.'"', $request, 1);
$request = preg_replace('/<ns1:(\w+)/', '<$1', $request);
$request = str_replace(array('/ns1:',
'xmlns:ns1="'.$namespace.'"'), array('/', ''),
$request);
// parent call
return parent::__doRequest($request, $location, $action, $version);
}
}
$client = new MSSoapClient(...);
?>
Hope this will save people endless hours of fiddling...
----
Server IP: 69.147.83.197
Probable Submitter: 130.89.167.43
----
Manual Page -- http://www.php.net/manual/en/function.soap-soapclient-dorequest.php
Edit -- https://master.php.net/note/edit/74123
Del: integrated -- https://master.php.net/note/delete/74123/integrated
Del: useless -- https://master.php.net/note/delete/74123/useless
Del: bad code -- https://master.php.net/note/delete/74123/bad+code
Del: spam -- https://master.php.net/note/delete/74123/spam
Del: non-english -- https://master.php.net/note/delete/74123/non-english
Del: in docs -- https://master.php.net/note/delete/74123/in+docs
Del: other reasons-- https://master.php.net/note/delete/74123
Reject -- https://master.php.net/note/reject/74123
Search -- https://master.php.net/manage/user-notes.php