Webservice Soapserver Build Should Not Depend On Client Data

Hi all,

I’m develop an application with some soap function expose to our client/parter, which connect to use over many NAT/firewall connections/networks.

There is a issue with soap server creation based on wsdl file. When Axis client (java) connect, it see an error:

SoapServer::SoapServer(http://xxx.xxx.xxx.44:8081/xxx/xxx/xxxservice/wsdl) [<a href='function.SoapServer-SoapServer'>function.SoapServer-SoapServer</a>]: failed to open stream: Connection timed out


The error happen in this line:

 $server=new SoapServer($this->wsdlUrl,$this->getOptions());

When i looking to it, the wsdlUrl with server host name was build from $_SERVER which client can change with http header "HOST: ip or domain"

In case $this->wsdlUrl build for client access wsdl file, it is OK. But this is not good because it depend on client data to build the soap-server, i expect it to get the wsdl locally.

As i dont want to tell every client to not send the HOST header, and sometime it’s not easy, How is the best way to modify code to not depend on this? (i am thinking of hardcode IP and port in this :) )