I have (mostly) figured out soap::lite. ... but the question is how? a loop of some sort is, obviously, needed. But where to I put it?
#!/usr/bin/perl -- use SOAP::Lite; my $soap = SOAP::Lite->proxy( 'http://localhost/blah/DummyService', timeout => 0.00001, ); $soap->transport->add_handler("request_send", \&pp_dump ); my $serializer = $soap->serializer(); my @data = ( SOAP::Data->name( 'request' => \SOAP::Data->value( SOAP::Data->name('actionTime')->value('actionTime'), SOAP::Data->name('id')->value('id')->type('long'), SOAP::Data->name('state')->value('state')->type('string'), SOAP::Data->name('result')->value('result')->type('string' +) ) ), SOAP::Data->name( 'request' => \SOAP::Data->value( SOAP::Data->name('actionTime')->value('actionTime'), SOAP::Data->name('id')->value('id')->type('long'), SOAP::Data->name('state')->value('state')->type('string'), SOAP::Data->name('result')->value('result')->type('string' +) ) ), ); print pp( $serializer->envelope( method => SOAP::Data->name('release')->attr( { 'xmlns', 'ns' } + ), @data, ), ); $soap->call( SOAP::Data->name('release')->attr( { 'xmlns', 'ns' } ), @data, ); sub pp { use XML::Twig; open my($fh), '>', \my $str; no warnings 'newline'; XML::Twig->new( qw! pretty_print record ! )->parse( @_ )->print( $fh ); return $str; } sub pp_dump { { my $content = $_[0]->content(''); $_[0]->content( pp($content) ); } print $_[0]->as_string,"\n"; return; }
In reply to Re: More Soap::Lite
by Anonymous Monk
in thread More Soap::Lite
by fritz1968
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |