This structure got me the farthest (I was either getting errors about it not being a hashref or arrayref, or a "panic: findName called without name" before). But now I'm getting this error:my $header = [{ parts => [{ name => 'token', element => 'tns:token', destination => $sessionToken, mustUnderstand => 1 }] }];
That despite when I do the login and do a dumper on the $answer variable I get this:error: cannot find element or attribute `{http://example.com/tns}token +'
Yet when I try to add that into the header with that same namespace, it complains it can't find the element. Now I tried making a schema just for this token (since it is not defined in any of the WSDLs or XSDs that the company whose API I am trying to access provides):Answer: $VAR1 = { 'parameters' => { 'Output' => { 'SessionToken' => 'sessiontokenv +alue' } }, '{http://example.com/tns}token' => bless( do{\(my $o = 44800 +400)}, 'XML::LibXML::Element' ) };
Now I get a different error: Can't call method "header" on unblessed reference at /usr/local/perl/5.16.1/lib/site_perl/5.16.1/XML/Compile/Transport/SOAPHTTP.pm line 340. So now it wants the header to be an object, and it appears the default value comes from HTTP::Headers (which is not the kind of header I want, I'm looking for the SOAP envelope header tag. So how do I build the header element? Thanks.<?xml version="1.0" encoding="utf-8"?> <xs:schema elementFormDefault="qualified" targetNamespace="http://example.com/tns" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.com/tns"> <xs:element name="token" nillable="true" type="xs:string" /> </xs:schema>
In reply to Re^2: Passing a session token using XML::Compile::WSDL
by SeptamusNonovant
in thread Passing a session token using XML::Compile::WSDL
by SeptamusNonovant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |