|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30359 SOAP client requests have no port in "Host" field
Submitted: 2004-10-08 10:59 UTC Modified: 2004-12-01 18:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sylvain dot pasche at camptocamp dot com Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.0.2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sylvain dot pasche at camptocamp dot com
New email:
PHP Version: OS:


 [2004-10-08 10:59 UTC] sylvain dot pasche at camptocamp dot com
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"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-14 21:48 UTC] 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 
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-12-01 18:00 UTC]
Thank you for patch. Committed into HEAD and PHP_5_0.
 [2012-01-16 09:39 UTC] giulio at pquod dot com
Same problem, the wsdl is fetched correctly, but next calls go to port 80 and not to port 81 specified in the URL.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 09:01:26 2024 UTC