AW: [Xml-compile] Transport::SOAPHTTP header option

Michael Ludwig m.ludwig at epages.com
Mon Nov 28 09:35:15 GMT 2011


> -----Ursprüngliche Nachricht-----
> Von: Gary Kennedy [mailto:gary at apnic.net]
> Gesendet: Montag, 28. November 2011 05:39

> So, my main question now is: How can I set/get cookies before/after a
> SOAP call?

Take control of the user agent to configure it and have it eat
as many cookies as you want.

my $ua = LWP::UserAgent->new;
$ua->ssl_opts( verify_hostname => 0, keep_alive => 1 );
$ua->cookie_jar({
    file => 'Kekse.txt', autosave => 1, ignore_discard => 1 });

my $trans = XML::Compile::Transport::SOAPHTTP->new(
    user_agent => $ua, timeout => 10, address => $srv_url );

my $call =
  $wsdl->compileClient( $opname, transport => $trans, port => $port );

my( $response, $trace ) = $call->( \%parms );

I'm using cookies here because the service I'm interfacing with uses
cookies for the session. There's a login call for obtaining the cookie
and once having received the cookie you can call the other web service
methods to do business.

Michael



More information about the Xml-compile mailing list