Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

printing SOAP::Lite generated XML envelopes

by chorankates (Novice)
on Sep 21, 2009 at 23:36 UTC ( #796633=perlquestion: print w/ replies, xml ) Need Help??
chorankates has asked for the wisdom of the Perl Monks concerning the following question:

I'm building my SOAP call "by hand" like so:
my $worker = SOAP::Lite->new(uri => $r_envelope{soapaction}, proxy => $r_envelope{endpoint}); my $response = $worker->call(SOAP::Data->name($r_envelope{method}) ->attr( { xmlns => $r_envelope{namespace} } ) => SOAP::Data->name(timestamp => $d_envelope{timestamp}), SOAP::Data->name(referenceId => $d_envelope{referenceId}), SOAP::Data->name(keycode => $d_envelope{keycode}), SOAP::Data->name(guid => $d_envelope{guid}), SOAP::Data->name(machineName => $d_envelope{machineName})
and I'd like to print out both the generated envelope (to be sent) and the one I receive back from the server. Right now, I'm printing the response envelope with:
Dumper($response->envelope);
Which works, but is less than ideal. What I'm really looking for is the SOAP envelopes themselves, like what gets printed when I:
use SOAP::Lite +trace => ['all', '-objects']
Can anyone provide some guidance in getting straight XML out of SOAP::Lite? (I'm using $response->valueof('//responseCode') for specific values, but my tool needs to be able to provide the full envelope to the end user.)

Comment on printing SOAP::Lite generated XML envelopes
Select or Download Code
Re: printing SOAP::Lite generated XML envelopes
by jrtayloriv (Pilgrim) on Sep 21, 2009 at 23:53 UTC
    I'm not too familiar with SOAP::Lite, but is the outputxml() method what you're after?
Re: printing SOAP::Lite generated XML envelopes
by Anonymous Monk on Sep 22, 2009 at 01:13 UTC
Re: printing SOAP::Lite generated XML envelopes
by Anonymous Monk on Sep 22, 2009 at 01:33 UTC
    print $soap->serializer->envelope( method => 'methodname', SOAP::Data->name(String_1 => 'one'), SOAP::Data->name(String_2 => 'two'), )

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://796633]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (18)
As of 2015-07-01 19:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (17 votes), past polls