Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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:
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.)

Replies are listed 'Best First'.
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 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:33 UTC
    print $soap->serializer->envelope( method => 'methodname', SOAP::Data->name(String_1 => 'one'), SOAP::Data->name(String_2 => 'two'), )

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://796633]
Approved by GrandFather
[erix]: potshots at potus. It was kinda encouring when they started shooting a republican senators ;)
[LanX]: I'm not calling for shooting Trump with a golf ball ;-)
[LanX]: this bullshit theater is distracting us from real issues
[choroba]: he will resign

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-08-18 13:02 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (301 votes). Check out past polls.