[Xml-compile] How to set a proxy server.

Mark Overmeer mark at overmeer.net
Mon Oct 19 15:15:29 GMT 2009


* Rob Coops (rcoops at gmail.com) [091019 14:19]:
> ... I am in an environment where I am forced to use a proxy server.

What kind of proxy is this?  Is it soap aware, or just tunneling?
When it is a simple tunnel, then you can overrule the destination with

   my $call = $wsdl->compileClient(operation => ..., 
     , server => 'soap.example.com:512'
     );

or   , endpoint => 'http//my-proxy/some-path'

The "server" keeps the path to the endpoint as specified in the WSDL in-tact,
only replaces the username:password at host:port component of the URI.  The
"endpoint" replaces all.

> I can create an LWP agent and make it use the proxy without any problems but I have
> yet to figure out how to make XML::Compile::WSDL11 use this LWP agent.

A lot of the objects are created automatically by default. But if you have
to diverge from the defaults, you have to build it step-by-step:

    my $lwp    = LWP::UserAgent->new(....);

    my $http   = XML::Compile::Transport::SOAPHTTP->new(user_agent => $lwp);
    my $sender = $http->compileClient(...);

    my $call   = $wsdl->compileClient
      ( operation => 'hello-world'
      , transport => $sender
      );

You can (=should) reuse the same $sender for all calls.
-- 
Success,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list