php.net |  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
Votes:1
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
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"
 /*



Patches

Pull Requests

History

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 
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-12-01 18:00 UTC] dmitry@php.net
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: Thu Oct 10 05:01:27 2024 UTC