From:             steffen dot herndl at gmx dot net
Operating system: Win XP Pro / LINUX
PHP version:      5.2.1
PHP Bug Type:     SOAP related
Bug description:  failed proxy authentication with parameters proxy_login and 
proxy_password

Description:
------------
I have problems using PHP-SOAP-Extension over a proxy with required
authentication.
We are using a "Checkpoint Firewall"
        
The Problem is reproducible under Windows XP Pro and Suse Linux 10 (and
probably further systems) and with different PHP Versions (done with 5.1.0,
5.1.2, 5.1.6, 5.2.1).
The SoapClient doesn't use the parameters proxy_login and proxy_password  
  for authentication. It only works with parameters for HTTP
authentication, but this causes other errors on the webservice. The
webservice tries then to autenticate with the proxy credentials.

If I specify the options login and password for HTTP authentication, the
script will pass the firewall check with the following headers. 
        POST http://(...)/WebService.asmx?WSDL HTTP/1.1
        Host: (...)
        Connection: Keep-Alive
        User-Agent: PHP-SOAP/5.2.1
        Content-Type: application/soap+xml; charset=utf-8;
action="http://reg.beb.de/ns/wsdl/FinanceService/2007-03/HelloWorld";
        Content-Length: 220
        Authorization: Basic SGVybmRsUzpzcHJpbmcwNzAz
        Proxy-Authorization: Basic SGVybmRsUzpzcHJpbmcwNzAz

Instead of the firewall error I get an error from the webService. Because
of the Authorization-Header the webserver tries to authenticate me,
although no authentication is needed.

Without firewall the communication works properly. The same request done
with nuSoap 0.7.2 and active firewall works too. (But I need to do this
with PHP-Extension because of performance reasons)

Reproduce code:
---------------
$_param_wsdl = "http://(...)/WebService.asmx?WSDL";
$_param_client_opt = array( 
  //HTTP connection through a proxy server
  "proxy_host" => "123.ab.cde", 
  "proxy_port" => 80, 
  "proxy_login" => "username",
  "proxy_password" => "password",
//DEBUG PURPOSE
  "trace" => true,
  "exceptions" => true
);

//make CLIENT 
  $SOAPClient = new SoapClient($_param_wsdl, $_param_client_opt);
  var_dump($SOAPClient);        

//do REQUEST
  $result = $SOAPClient->HelloWorld();
  var_dump($result);    


Expected result:
----------------
It should work without errors...




Actual result:
--------------
Warning: SoapClient::SoapClient(http://(...)/WebService.asmx?WSDL)
[function.SoapClient-SoapClient]: failed to open stream: 
        HTTP request failed! HTTP/1.0 401 Unauthorized in C:\htdocs\soap.php on
line 37
        
Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O
warning : failed to load external entity 
        "http://(...)/WebService.asmx?WSDL" in C:\htdocs\soap.php on line 37
        
SoapFault Object
(
            [message:protected] => SOAP-ERROR: Parsing WSDL: Couldn't load from
'http://(...)/WebService.asmx?WSDL'
            [string:private] => 
            [code:protected] => 0
            [file:protected] => C:\htdocs\soap.php
            [line:protected] => 37
            [trace:private] => Array
                (
                    [0] => Array
                        (
                            [file] => C:\htdocs\soap.php
                            [line] => 37
                            [function] => SoapClient
                            [class] => SoapClient
                            [type] => ->
                            [args] => Array
                                (
                                    [0] => http://(...)/WebService.asmx?WSDL
                                    [1] => Array
                                        (
                                            [soap_version] => 2
                                            [proxy_host] => 123.ab.cde
                                            [proxy_port] => 80
                                            [proxy_login] => username
                                            [proxy_password] => password
                                            [trace] => 1
                                            [exceptions] => 1
                                        )

                                )

                        )

                )

            [faultstring] => SOAP-ERROR: Parsing WSDL: Couldn't load from
'http://(...)/WebService.asmx?WSDL '
            [faultcode] => WSDL
)

-- 
Edit bug report at http://bugs.php.net/?id=40936&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40936&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40936&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40936&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40936&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40936&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40936&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40936&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40936&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40936&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40936&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40936&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40936&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40936&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40936&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40936&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40936&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40936&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40936&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40936&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40936&r=mysqlcfg

Reply via email to