Re: [soaplite] Re: Need help with proxy setting
- Hi Brian
>Got something... but perhaps I'm talking to myself anymore... :)In the docs for the SOAP::Transport::HTTP package there is an example
>I can't figure out how to get the SOAP::Lite->service() syntax to
>work, when going through a proxy server. (Please help!) I've found
>of a couple workarounds, both of which are undesirable!
>Here's 2 solutions, then a full recap of the problem:
>Instead of using the very handy, lovely, wonderful, happy, WSDL
>description using SOAP::Lite->service(), use the uglier version:
> print SOAP::Lite
> -> uri('urn:xmethods-delayed-quotes')
> -> proxy('http://services.xmethods.net/soap',
> proxy => [http => 'http://my-proxy:80'])
> -> getQuote('MSFT')
> -> result;
>Found that syntax from the SOAP::Lite documentation at
>http://cpan.uwinnipeg.ca/htdocs/SOAP-Lite/SOAP/Lite.html - somewhat
of how to use an http proxy.
>I don't understand why "proxy" in the first (method) case meansThe extra parameters to proxy are passed to the SOAP::Transport
>"endpoint URI" and "proxy" in the second (unnamed hash, key) really
>means "proxy server".
object and are treated as parameters to LWP::UserAgent, which is the
class used by S::L for the HTTP client. If you look at the docs for
LWP::UserAgent then you will see the reason for the syntax and also
other parameters that can be specified, such as the HTTP timeout.
It is unfortunate that proxy is used by S::L to simply mean 'the
endpoint to connect to'.
>So, the "proxy" method of SOAP::Lite allows a further argument ofAgain, it is the LWP package that uses the environment
>proxy server[s], but service() doesn't...
>Second (untested) use WGET or something to grab the WSDL, then use
>service() method on the LOCALLY STORED WSDL.
>The problem again: the UNIX distribution appears to ignore the
>environment variable 'http_proxy', whereas Windows finds and uses it
>when trying to access a SOAP service on the other side of a firewall.
variables, not S::L.
A quick look at the code in SOAP/Transport/HTTP.pm shows that S::L is
expecting the environment variable to be 'HTTP_proxy'. Linux is cases
sentitive, while Windows isn't. I'm not sure why it has been made
case sensitive as LWP::UserAgent isn't.