Kieron Johnson <[email protected]> writes:

> Thanks Mark. I couldn't see that in the docs though it's quite clearly
> documented! Did noticed the docs say to use "hook =>" but it looks
> like it
> should be "transport_hook =>"
>
> I achieved what I wanted with below code. Very straightforward thanks.
>
> # Compile request method from WSDL
>
> # Hook in sub for Authorization header
>
> my $call = $wsdl->compileClient( $method, transport_hook =>
> \&transport_hook );

For basic authorization I use:

$authoriz = 'Basic'.encode_base64('user:password');

$ua = LWP::UserAgent->new(timeout => 'mytout');

$ua = default_header(Authorization => $authoriz);

$trans = XML::Compile::Transport::SOAPHTTP->new(address =>
'myaddress',user_agent => $ua);

or

$authoriz = 'Basic'.encode_base64('user:password');

$trans = XML::Compile::Transport::SOAPHTTP->new(address => 'myaddress');

$ua = $trans->userAgent();

$ua->default_header(Authorization => $authoriz);


-- 
Radek

_______________________________________________
Xml-compile mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile

Reply via email to