PHP 8.5.0 Alpha 4 available for testing

Voting

: four minus three?
(Example: nine)

The Note You're Voting On

albert at jool dot nl
18 years ago
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...

<< Back to user notes page

To Top