Bug #69783 [Com]: Webservice wsdl cache and proxy causes "Could not connect to host" error

From: Date: Mon, 17 Oct 2016 15:12:00 +0000
Subject: Bug #69783 [Com]: Webservice wsdl cache and proxy causes "Could not connect to host" error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204872@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69783&edit=1

 ID:                 69783
 Comment by:         paolomainardi at gmail dot com
 Reported by:        maciej dot lizewski at 3e dot pl
 Summary:            Webservice wsdl cache and proxy causes "Could not
                     connect to host" error
 Status:             Open
 Type:               Bug
 Package:            SOAP related
 Operating System:   Debian Linux
 PHP Version:        5.6.9
 Block user comment: N
 Private report:     N

 New Comment:

I confirm the very same bug on PHP 7.0.12


Previous Comments:
------------------------------------------------------------------------
[2015-06-09 09:28:47] maciej dot lizewski at 3e dot pl

Description:
------------
We need to connect to SSL WebService through Squid proxy.

When we connect with proxy and without wsdl cache (on disk) - it works fine
When we connect without proxy and with wsdl cache (on disk) - it works fine

when we connect with both wsdl cache on disk and proxy - only first request works (which creates
cache file). All subsequent calls fail with "Could not connect to host" error. When cache
file is wiped out - next request works fine, and again subsequent throw an error.

another thing is that we have to provide proxy configuration in both SoapClient options and Stream
Context. When only provided in one place - same error is thrown ("Could not connect to
host").

Test script:
---------------
$opts = array( 'http'=>array( 'proxy'=>'tcp://[proxy host]:3128'
) );
$context = stream_context_create( $opts );

$client = new SoapClient( 'https://webapi.allegro.pl/service.php?wsdl',
array( 'proxy_host'=>'[proxy host]', 'proxy_port'=>3128,
'cache_wsdl'=>WSDL_CACHE_BOTH, 'stream_context'=>$context ) );

$request = array(
    'sysvar' => 1,
    'countryId' => 1,
    'webapiKey' => '[secret]'
);

try{
    var_dump( $client->doQuerySysStatus( $request ) );
}catch(SoapFault $e){
    echo $e->getCode() . ' ' . $e->getMessage() . "\n";
}


Expected result:
----------------
WSDL cache should work and it should use cached data when using proxy.

Actual result:
--------------
We can use only wsdl cache or proxy at once. Using both causes connection errors.


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



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


Thread (3 messages)

« previous php.bugs (#204872) next »