|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38703 SOAP Basic Authentication Failure Error Messages
Submitted: 2006-09-03 22:18 UTC Modified: 2006-09-12 08:05 UTC
Avg. Score:4.1 ± 0.8
Reproduced:20 of 20 (100.0%)
Same Version:4 (20.0%)
Same OS:7 (35.0%)
From: chris at reeltwo dot com Assigned: dmitry
Status: Wont fix Package: SOAP related
PHP Version: 5.1.6 OS: Windows XP
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-09-03 22:18 UTC] chris at reeltwo dot com
When an incorrect user name or password is passed to a SoapClient in WSDL mode, the resulting SoapFault exception which is thrown contains the generic faultstring of "SOAP-ERROR: Parsing WSDL: Couldn't load from..." and faultcode of "WSDL". A warning is given with "HTTP request failed! HTTP/1.1 401 Unauthorized", however this is not catchable. The more desirable result in the case would be the same as non-WSDL mode where the faultstring is "Unauthorized" and faultcode is "HTTP".

Reproduced on Windows XP with Apache/2.0.55 PHP 5.1.6, Apache/2.2.3 PHP 5.2.0 (20060830) and Apache/2.2.3 PHP 6.0.0 (20060830).

Reproduce code:
/* WSDL is behind basic authentication */
try {
  $soap = new SoapClient('http://localhost/some.wsdl', array('login' => 'badlogin', 'password' => 'badpass'));
} catch (SoapFault $e) {
  echo '<p>Fault String: '.$e->faultstring.'<p>';
  echo '<p>Fault Code: '.$e->faultcode.'<p>';

Expected result:
Fault String: Unauthorized

Fault Code: HTTP

Actual result:
Warning: SoapClient::__construct({snip:wsdl}) [function.SoapClient---construct]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in {snip:path}

Warning: SoapClient::__construct() [function.SoapClient---construct]: I/O warning : failed to load external entity "{snip:wsdl}" in {snip:path}

Fault String: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/some.wsdl'

Fault Code: WSDL


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-04 08:34 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-09-04 23:52 UTC] chris at reeltwo dot com
The problem still occurs using the latest snapshot.
 [2006-09-05 12:43 UTC]
ext/soap reuses libxml and php streams API code to load WSDL files. I don't like rewrite streams code in ext/soap, but this code is not able throw exceptopns.

As a workarounf I suggest tricks with set_error_handler().
 [2006-09-06 20:54 UTC] chris at reeltwo dot com
Thanks, I've used the set_error_handler() workaround.
 [2006-09-08 20:26 UTC]
Dmitry, so what's the status of this report?
"Won't fix"?
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 14:01:35 2015 UTC