I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2012-03-26 09:16:11.316762-07 by dday376
Adding Headers to Call
I need to add two complex elements to a header to make the call, one is the WSSE Security header, the other is application specific. I created the types and elements, and I'm doing this:
my $appParameters = DrmTypes::AppParameters->new({ serverUrl => 'http://drmd.nwie.net:5242/Oracle/Drm/APIAdapter', sessionParams => 'ProductVersion=11.1.2;CultureName=en-US', }); my $usernameToken = WsseTypes::UsernameToken->new({ Username => $drm_username, Password => $drm_password, }); my $security = WsseTypes::Security->new({ UsernameToken => $usernameToken, }); my $result = $service->getUserNames( undef, ($security, $appParameters) );
The resulting call looks like this:
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://sch +emas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <UsernameToken> <Username xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1 +.0.xsd">drmread</Username> <Password xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1 +.0.xsd">XXXXXX</Password> </UsernameToken> </SOAP-ENV:Header> <SOAP-ENV:Body> <getUserNames xmlns="http://drm.webservices.epm.oracle" /> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
What I need is a call that looks like this (created using SOAP::Lite, works):
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:drm="http://drm.webservices.epm.oracle" xmlns:xsi="http://www.w3.org/2001/XMLS +chema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3 +.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="ht +tp://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-s +ecext-1.0.xsd"> <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecu +rity-utility-1.0.xsd"> <wsse:Username>drmread</wsse:Username> <wsse:Password>XXXXXX</wsse:Password> </wsse:UsernameToken> </wsse:Security> <drm:AppParameters> <drm:serverUrl>http://drmd.nwie.net:5242/Oracle/Drm/APIAdapter</drm:serverUrl> <drm:sessionParams>ProductVersion=11.1.2;CultureName=en-US</drm:sessionParams> </drm:AppParameters> </soap:Header> <soap:Body> <drm:getUserNames xsi:nil="true" /> </soap:Body> </soap:Envelope>
Two things: 1) How on earth do I turn on tracing or debugging? I'm using wireshark to see what is being sent, and it's kind of a pain. 2) Clearly I haven't figured out the right way to insert the headers correctly. What am I doing wrong? Thanks! - D.
Direct Responses: 13682 | 13732 | Write a response