#42637 [Com]: SoapFault : Only http and https are allowed
| From: | wmoran at collaborativefusion dot com | Date: | Fri, 28 Sep 2007 15:45:48 +0000 |
| Subject: | #42637 [Com]: SoapFault : Only http and https are allowed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-117934@lists.php.net to get a copy of this message | ||
ID: 42637
Comment by: wmoran at collaborativefusion dot com
Reported By: christof at sanmax dot be
Status: Assigned
Bug Type: SOAP related
Operating System: Linux
PHP Version: 5.2.4
Assigned To: dmitry
New Comment:
I have yet more information. The problem is related to HTTP redirect
codes (3XX). PHP attempts to follow the redirect, but if the ->scheme
is not provided in the redirect URL, PHP leaves it NULL.
See the changes in php_http.c around line 921:
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?view=diff&r1=1.77.2.11.2.5%3Aphp_5_2_1&tr1=1.109&r2=1.77.2.11.2.12%3Aphp_5_2_4&tr2=1.1&diff_format=h
I'm unclear as to the logic in the 5.2.4 code, as the 5.2.1 version
seems to be correct, or at least:
new_url->scheme = phpurl->scheme ? estrdup(phpurl->scheme) : NULL;
would make more sense to me.
In particular, it's significant to note that you can not reproduce this
unless your soap server issues a 3XX response to your original request,
and does not include a scheme in the Location header of that response.
Previous Comments:
------------------------------------------------------------------------
[2007-09-27 16:19:50] wmoran at collaborativefusion dot com
Correction to my last note:
It worked in 5.2.1. I have no testing history against 5.2.2 and 5.2.3.
------------------------------------------------------------------------
[2007-09-27 16:04:16] wmoran at collaborativefusion dot com
I can narrow this down a bit further. We did not see this behavior
with 5.2.3, but it occurs with 5.2.4.
------------------------------------------------------------------------
[2007-09-12 06:51:02] christof at sanmax dot be
Description:
------------
When sending a request with the SoapClient, a SoapFault is produced :
Fatal error: Uncaught SoapFault exception: [HTTP] Unknown protocol.
Only http and https are allowed.
The probleem seems to be located in the php_url_parse_ex function. In
version 5.1.6 it works fine, in 5.2.4 is does not. The php scheme is
null instead of http according to our tests.
Reproduce code:
---------------
$base = 'http://<some soap service
url>/service.asmx?WSDL';
$soap = new SoapClient($base, array('trace' => 1));
$login = new StdClass;
$login->userName = 'test';
$login->passWord = 'test';
$login->languageCode = 'NL';
$loginResult = $soap->Login($login);
Expected result:
----------------
no soapfault. In php 5.1.6 it works fine, no exception is thrown.
Actual result:
--------------
Fatal error: Uncaught SoapFault exception: [HTTP] Unknown protocol.
Only http and https are allowed in
/home/data/websites/www/phptest.php:10
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...',
'http://demobet5...', 'http://XServer....', 1, 0)
#1 [internal function]: SoapClient->__call('Login', Array)
#2 /home/data/websites/www/phptest.php(10):
SoapClient->Login(Object(stdClass))
#3 {main}
thrown in /home/data/websites/www/phptest.php on line 10
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42637&edit=1