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

I am assuming you are working on a soap client?

I'm not entirely sure what you're asking but here goes. Generally the only two things the soap object need to know before you can start making function calls are uri of the soap service and the location of the soap service

my $soap = new SOAP::Lite => uri('http://dev.crescentsun.com/soap/services') => proxy('https://dev.crescentsun.com/soap/listener.c +gi')

I'm just learning this stuff myself as well, and found that this article (and it's part two) from Perl.com of use.

Replies are listed 'Best First'.
Re: Re: soap::lite - specifying a http gateway
by zakzebrowski (Curate) on May 10, 2001 at 17:38 UTC
    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

      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.