From: chris at reeltwo dot com
Operating system: Windows XP
PHP version: 5.1.6
PHP Bug Type: SOAP related
Bug description: SOAP Basic Authentication Failure Error Messages
Description:
------------
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
--
Edit bug report at http://bugs.php.net/?id=38703&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38703&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38703&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38703&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38703&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38703&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38703&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38703&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38703&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38703&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38703&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38703&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38703&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38703&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38703&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38703&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38703&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38703&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38703&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38703&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38703&r=mysqlcfg