Edit report at https://bugs.php.net/bug.php?id=47761&edit=1

 ID:                 47761
 Comment by:         clockw...@php.net
 Reported by:        marques at displague dot com
 Summary:            Since 5.2.9 SoapClient no longer attempts Basic auth
                     to retrieve a WSDL file
 Status:             No Feedback
 Type:               Bug
 Package:            SOAP related
 Operating System:   *
 PHP Version:        5.2.9
 Block user comment: N
 Private report:     N

 New Comment:

See https://gist.github.com/1765797

The WSDL depicted there is behind a load balancer which deals with the SSL bits 
- it's actually served 
over https.

While the initial basic auth works, further requests don't appear to.

I suspect>
 1. WSDL loaded over HTTPS with HTTP Basic Auth
 2. WSDL points to a http address with a port, which is not recognised as the 
same site
 3. A new request is made to grab the xsd bits
 4. The server redirects http to https

Expected:
At step 4, the http basic auth credentials are used

Actual:
SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema 
from 
'http://*****:80/codetable-service/CodeTableService?xsd=3' in settings.php:82
Stack trace:
#0 settings.php(82): SoapClient->SoapClient('https://****...', Array)
#1 ettings.php(2): require('...')
#2 {main}

Warning: 
SoapClient::SoapClient(http://****:80/codetable-service/CodeTableService?xsd=3) 
[soapclient.soapclient]: failed to open stream: HTTP request failed! HTTP/1.1 
401 Unauthorized in 
settings.php on line 82

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed 
to load external entity 
"http://****:80/codetable-service/CodeTableService?xsd=3"; in settings.php on 
line 82


Previous Comments:
------------------------------------------------------------------------
[2012-02-08 05:31:24] clockw...@php.net

$ php -v
PHP 5.2.17-0.dotdeb.0 with Suhosin-Patch 0.9.7 (cli) (built: Jan  7 2011 
07:47:48)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

Doing:

<?php
$wsdl = ...;

$soapOptions = array(
    'login' => '...',
    'password' => '...',
    'trace' => 1,
    'exceptions' => true,
);
$code_table_client = new RPDesktopCodeTableSoapClient(new SoapClient($wsdl, 
$soapOptions));

The basic auth works for the initial connection, but other components of the 
WSDL that are being referred to don't load the credentials.

------------------------------------------------------------------------
[2009-10-07 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2009-09-29 11:20:40] sjo...@php.net

Thank you for your bug report.

How did you try to pass the username and password to the SOAP client? Please 
try putting them in the URL, like this:
http://user:p...@www.example.com/service.wsdl

------------------------------------------------------------------------
[2009-08-07 03:52:10] marques at displague dot com

One scenario, you are making your own SOAP Server service.  It is  more 
difficult to write a digest auth server than it is to write a basic auth 
server.  Again, consider that PHP web requests are all made as HTTP/1.0 because 
Chunk decoding is not handled properly (or at all) and so Digest, which is 
HTTP/1.1 specific is technically not an option without a good deal of custom 
coding.

Aside from that, I imagine there are just some HTTP/1.0 or Basic only servers 
out there.

------------------------------------------------------------------------
[2009-08-06 22:02:12] sriram dot natarajan at gmail dot com

why is there still a need to support basic authentication ? can u kindly 
explain that scenario ?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=47761


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=47761&edit=1

Reply via email to