[Xml-compile] Basic Authentication
DEIGNAN Ciaran
C.DEIGNAN at rsd.com
Mon Oct 27 10:59:13 GMT 2014
Hi Kaare,
Marc must be on holiday, so let me try.
I pass the WSS object in to the call(), like this
## Web Service Security
my $security = $wss->wsseBasicAuth('user', 'passwd');
($ret, $trace) = $ws->call('getImportDataSchema', wsse_Security => $security,
parentFullQCode => $FQC, recordFormat => 'ERCD', nodeType => 'RECORD');
Hope this helps,
Ciaran Deignan
RSD Open Systems Support
-----Original Message-----
From: Kaare Rasmussen [mailto:kaare at jasonic.dk]
Sent: jeudi 23 octobre 2014 08:22
To: xml-compile at lists.scsys.co.uk
Subject: [Xml-compile] Basic Authentication
Hi
Basic Authentication just doesn't seem to 'attach' to the calls. What am
I doing wrong here?
use XML::Compile::SOAP::WSS;
use XML::Compile::WSDL11;
use XML::Compile::SOAP11;
use XML::Compile::Transport::SOAPHTTP;
my $wsdlfn = '...';
my $xsdfn = '...;
my $user = '...';
my $password = '...';
my $wss = XML::Compile::SOAP::WSS->new; # Should hook the WSDL parser
my $wsdl = XML::Compile::WSDL11->new($wsdlfn);
$wsdl->importDefinitions($xsdfn);
my $auth = $wss->basicAuth(
username => $user,
password => $password,
);
... and then compileClient and call. The request headers look like this
with $trace->printRequest:
User-Agent: libwww-perl/6.07
Content-Length: 1043
Content-Type: text/xml; charset="utf-8"
SOAPAction: "sendNotification"
X-LWP-Version: 6.07
X-XML-Compile-Cache-Version: 1.02
X-XML-Compile-SOAP-Version: 3.05
X-XML-Compile-Version: 1.47
X-XML-LibXML-Version: 2.0116
So it fails with 401. Now, if I write a transport_hook myself, I get the
correct authentication, and the call is successful.
Obviously I'm missing something when trying to use
XML::Compile::SOAP::WSS. But I can't see what (?)
_______________________________________________
Xml-compile mailing list
Xml-compile at lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile
More information about the Xml-compile
mailing list