PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » SOAP » Bug #1119

Problem using a Proxy Server with WSDL

Details

Submitted2004-04-02 22:51 UTC
Frombrian dot bush at alltel dot com
StatusNo Feedback
PackageSOAP
PHP Version4.3.4
OSSunOS 5.8
Roadmaps(Not assigned)

Comments

[2004-04-02 22:51 UTC] brian dot bush at alltel dot com

Description:
------------
There was a very similar problem in Bug #300.
http://pear.php.net/bugs/bug.php?id=300&edit=2

The second parameter of SOAP_WSDL should be for your proxy server info as per HTTP_Request. It looks like that array get sent to $this->proxy, then I lose track of it.

Later in WSDL.php, line 808, the "get" function is passed a proxy_params variable. I'm not sure when this function is called, so I couldn't find what is being passed to proxy_params.

Anyway, on line 859, the "setProxy" function from HTTP_Request is called. My proxy data is not being passed on. One reason is because we do not require authentication to our proxy and the function is only calling setProxy if you pass a username/password combination. I am also concerned that the proxy_params array is not the array I am passing to the SOAP_WSDL constructor.

Reproduce code:
---------------
<?php
include("SOAP/Client.php");
print "<br>\n<strong>wsdl:</strong>";
$wsdl = new SOAP_WSDL(
"http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl",
array("proxy.company.com"));
$soapclient = $wsdl->getProxy();

print_r($soapclient->getQuote("ibm"));
print "\n\n";
?>

Expected result:
----------------
wsdl:94.2

Actual result:
--------------
Warning: fsockopen(): unable to connect to 66.28.98.121:80 in /usr/local/lib/php/Net/Socket.php on line 108
Warning: reset(): Passed variable is not an array or object in /usr/local/lib/php/SOAP/WSDL.php on line 597
Warning: current(): Passed variable is not an array or object in /usr/local/lib/php/SOAP/WSDL.php on line 598
Warning: reset(): Passed variable is not an array or object in /usr/local/lib/php/SOAP/WSDL.php on line 439
Warning: current(): Passed variable is not an array or object in /usr/local/lib/php/SOAP/WSDL.php on line 440
Fatal error: Cannot instantiate non-existent class: webservice_ in /usr/local/lib/php/SOAP/WSDL.php on line 618

[2004-06-30 15:03 UTC] rangi dot robinson at framestore-cfc dot com

I was having the same problem. I replaced:

if (isset($proxy_params['proxy_user']) && isset($proxy_params['proxy_pass'])) {
$rq->setProxy($proxy_params["proxy_host"],$proxy_params["proxy_port"],
$proxy_params["proxy_user"],$proxy_params["proxy_pass"]);
}

with

if (isset($proxy_params['proxy_host']) && isset($proxy_params['proxy_port'])) {
$rq->setProxy($proxy_params["proxy_host"],$proxy_params["proxy_port"],
$proxy_params["proxy_user"],$proxy_params["proxy_pass"]);
}

and now it's working fine.

Rangi

[2004-06-30 15:04 UTC] rangi dot robinson at framestore-cfc dot com

Forgot to mention that those changes were made in WSDL.php