Bug #30359 [Com]: SOAP client requests have no port in "Host" field
Edit report at https://bugs.php.net/bug.php?id=30359&edit=1
ID: 30359
Comment by: giulio at pquod dot com
Reported by: sylvain dot pasche at camptocamp dot com
Summary: SOAP client requests have no port in "Host" field
Status: Closed
Type: Bug
Package: SOAP related
PHP Version: 5.0.2
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Same problem, the wsdl is fetched correctly, but next calls go to port 80 and not to port 81
specified in the URL.
Previous Comments:
------------------------------------------------------------------------
[2004-12-01 18:00:17] dmitry@php.net
Thank you for patch. Committed into HEAD and PHP_5_0.
------------------------------------------------------------------------
[2004-10-14 21:48:28] chris at atomicobject dot com
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.
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=30359&edit=1
Thread (5 messages)