Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: SOAP::Lite, WSDLs and Raw XML Data

by Anonymous Monk
on Jun 12, 2008 at 11:03 UTC ( #691627=note: print w/ replies, xml ) Need Help??

in reply to SOAP::Lite, WSDLs and Raw XML Data

Here's an example adopted from

#!/usr/bin/perl -- # adopted from # perl -MSOAP::Lite=debug -S +amples.cgi getStateList([1,9]) use warnings; use strict; use SOAP::Lite; use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1; use SOAP::Lite +trace => 'debug'; @ARGV = qw[ ]; my ( $proxy, $uri ) = ( shift, shift ); my $soap = SOAP::Lite->proxy($proxy)->on_fault( sub { } ); $soap->uri($uri) if $uri; $soap->readable(1); # lifesaver my $raw_xml = q~<soapenc:Array soapenc:arrayType="xsd:int[2]" xsi:type="soapenc:Ar +ray"> <item xsi:type="xsd:int">1</item> <item xsi:type="xsd:int">9</item> </soapenc:Array>~; my $res = $soap->getStateList( SOAP::Data->type( 'xml' => $raw_xml ) ) +; #my $res = $soap->getStateList([1,9]); die join "\n", "--- SOAP FAULT ---", $res->faultcode, $res->faultstrin +g, '' if defined($res) && $res->fault; die join "\n", "--- TRANSPORT ERROR ---", $soap->transport->status, '' if !$soap->transport->is_success; print STDERR join "\n", "--- SOAP RESULT ---", Dumper( $res->paramsall + ), ''; __END__ SOAP::Transport::HTTP::Client::send_receive: POST http://services.soap HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 668 Content-Type: text/xml; charset=utf-8 SOAPAction: "" <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="" xmlns:soapenc="" xmlns:xsd="" soap:encodingStyle="" xmlns:soap=""> <soap:Body> <getStateList xmlns=""> <s +oapenc:Array soapenc:arrayType="xsd:int[2]" xsi:type="soapenc:Array"> <item xsi:type="xsd:int">1</item> <item xsi:type="xsd:int">9</item> </soapenc:Array> </getStateList> </soap:Body> </soap:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Thu, 12 Jun 2008 10:54:40 GMT Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/ +2.4.2 mod_gzip/ PHP/4.4.8 mod_ssl/2.8.22 OpenSSL/0.9.7e Content-Length: 683 Content-Type: text/xml; charset=utf-8 Client-Date: Thu, 12 Jun 2008 10:58:23 GMT Client-Peer: Client-Response-Num: 1 SOAPServer: SOAP::Lite/Perl/0.55 <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="ht +tp://" xmlns:SOAP-ENC="http://schem" xmlns:SOAP-ENV="http://schemas.xmlsoap" xmlns:xsd="" SOA +P-ENV:encodingStyle=""><SOAP +-ENV:Body><namesp1:getStateListResponse xmlns:namesp1="http://www.soa"><SOAP-ENC:Array xsi:type="SOAP-ENC:Array" SOAP +-ENC:arrayType="xsd:string[2]"><item xsi:type="xsd:string">Alabama</i +tem><item xsi:type="xsd:string">Florida</item></SOAP-ENC:Array></name +sp1:getStateListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> --- SOAP RESULT --- [ 'Alabama', 'Florida' ]

Comment on Re: SOAP::Lite, WSDLs and Raw XML Data
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://691627]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2015-11-27 06:44 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (719 votes), past polls