Myself and my friend are located in 2 different locations and we are developing a project which uses webservices using PHP.  My friend was developing the server part in his laptop and I was developing the client part.

This is our first webservice project and we tried to integrate both of our components in a web server and the fun started.

We hit the below error

DTD are not supported by SOAP

I was blaming him that he has done something wrong and he started blaming me too… We spent almost half a day and finally figure out the problem.

The problem was both of us using our localhost (XAMPP) to develop our web servers.  But we forgot the part that when we upload to server we need to change the URL from localhost to the web domain name.

Where the URL is located

When you develop the server component you create a .wsdl and a equivalent .php file.  Our web service is named as ‘wpmobile’ and so we had ‘wpmobile.wsdl’ and ‘wpmobile.php’.  The URL is located in the ‘wpmobile.wsdl’ with the XML name tag ‘soap:address’.

<soap:address location='http://localhost/wpserver/wpmobile.php'/>

Changed the above as below and it started working

<soap:address location=''/>

This is very common mistake many of us do.