Search code examples
phpsoapsoapserver

PHP SoapServer ampersand is encoded


I'm working on a webservice using SoapServer in PHP. Previously, I made another webservice using exactly the same technique. My new project is on the same server, but in another subdirectory. In the url of the service and the soapserver is a version number included. This is the way my SoapServer is created in PHP:

$server = new SoapServer("https://".DOMAIN."/webservice/index.php?v=1.0.0&wsdl=1");
$server->setClass('SoapHandler');
$server->handle();

The whole PHP page is the same in my example Soap Service, only the url is different ofcourse. When I do a call to the webservice with soapUI, the following error is returned:

SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://myurl.com/webservice/index.php?v=1.0.0&wsdl=1' : failed to load external entity "https://myurl.com/webservice/index.php?v=1.0.0&wsdl=1"

As you can see, the ampersand is replaced with &. I tried to change the encoding to UTF-8, this doesn't work either.

Who can help me out?


Solution

  • We had an .htaccess, only allowing my IP address while it should also allow the server's IP.. Deleting this solved the problem. Thanks for your help!