in reply to Re: soap::lite - specifying a http gateway
in thread soap::lite - specifying a http gateway

Right, but my computer is behind a gateway at work, and I can't connect to the outside world directly without using the gatekeeper. The two articles actually was what got me interested in soap::lite... I'll let you know if I get any further with this. *Thanks*

----
Zak
  • Comment on Re: Re: soap::lite - specifying a http gateway

Replies are listed 'Best First'.
Re: Re: Re: soap::lite - specifying a http gateway
by AidanLee (Chaplain) on May 10, 2001 at 18:14 UTC

    from the SOAP::Lite documentation:

    proxy()

    Shortcut for transport->proxy(). This lets you specify an endpoint (service address) and also loads the required module at the same time. It is required for dispatching SOAP calls. The name of the module will be defined depending on the protocol specific for the endpoint. The prefix SOAP::Transport will be prepended, the module will be loaded and object of class (with appended ::Client) will be created.

    For example, for http://localhost/, the class for creating objects will look for SOAP::Transport:HTTP::Client;

    In addition to endpoint parameter, proxy() can accept any transport specific parameters that could be passed as name => value pairs. For example, to specify proxy settings for HTTP protocol you may do:

    $soap->proxy('http://endpoint.server/', proxy => ['http' => 'http://my.proxy.server/']);
    ...

    note the extra parameter specifying a proxy server. the documentation can be found here.

      EXCELLENT - Got it to work... Thanks! :)

      ----
      Zak
      Absolutely right. In general almost everything that passed as additional parameters for proxy call will go to transport library that implements it: LWP::UserAgent for http, MIME::Lite for smtp/sendmail, etc.

      You may specify cookies (examples/cookieauth.pl):

      my $soap = SOAP::Lite
        -> uri('urn:xmethodsInterop')
        -> proxy('http://services.xmethods.net:80/soap/servlet/rpcrouter', 
                 cookie_jar => HTTP::Cookies->new(ignore_discard => 1))
      ;
      
      proxy:
      my $soap = SOAP::Lite
        -> uri('urn:xmethodsInterop')
        -> proxy('http://services.xmethods.net:80/soap/servlet/rpcrouter', 
                 proxy => 'http://my.proxy.server/')
      ;
      
      or anything else that underlying transport library supports.

      If you need proxy authentication you need to specify both proxy server and use authentication as in examples/authentication.pl. Hope it helps. I'm working on SOAP cookbook that should have ready-to-use code for such cases.

      Best wishes, Paul.