ID: 30359 Comment by: chris at atomicobject dot com Reported By: sylvain dot pasche at camptocamp dot com Status: Open Bug Type: SOAP related PHP Version: 5.0.2 New Comment:
I am experiencing this problem trying to connect to a SOAP service on port 8080 and 8880 (both NOT port 80). PHP can fetch the WSDL perfectly fine (constructor: new SoapClient("http://hostname:8080/path/to/Service?wsdl")) but all SOAP requests go to hostname:80. I have used ethereal to watch the HTTP traffic, and the resulting WSDL specifies the correct host and port, but PHP soap client doesn't seem to use it. I have not tried the patch specified with this bug though. Previous Comments: ------------------------------------------------------------------------ [2004-10-08 10:59:28] sylvain dot pasche at camptocamp dot com Description: ------------ according to the HTTP 1.1 RFC, section 14.23: " A "host" without any trailing port information implies the default port for the service requested (e.g., "80" for an HTTP URL). " This patch seems to corrects this: --- php_http.c.orig 2004-10-08 10:46:50.000000000 +0200 +++ php_http.c 2004-10-08 10:44:10.000000000 +0200 @@ -382,6 +382,12 @@ smart_str_append_const(&soap_headers, " HTTP/1.1\r\n" "Host: "); smart_str_appends(&soap_headers, phpurl->host); + + if (phpurl->port != 80) { + smart_str_append_const(&soap_headers, ":"); + smart_str_append_unsigned(&soap_headers, phpurl->port); + } + smart_str_append_const(&soap_headers, "\r\n" "Connection: Keep-Alive\r\n" /* ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30359&edit=1