Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I used the program that's distributed with SOAP::Lite to create an SOAP client and I can't seem to retrieve the data correctly. The relative snippet of code is this:

my $som = $self ->endpoint($method{endpoint}) ->uri($method{uri}) ->on_action( sub { qq/"$method{soapaction}"/ } ) ->call($method => map { @templates ? shift(@templates)->value( +$_) : $_ } @_); return $som unless UNIVERSAL::isa($som => 'SOAP::SOM'); return wantarray ? $som->paramsall : $som->result;

I used Data::Dumper on the SOAP::SOM ($som) object that was returned and buried deep in the data structure is the data that I need. $self->call is returning a SOAP::SOM object and I'm calling it in list context, so it's the $som->paramsall method which is failing. It returns the following data structure:

@movies = ( { 'Movies' => { 'Movie' => '' } } );

The XML returned by the SOAP call resembles the following (with many thousands of movies cut out and this is actually returned on one line.)

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd=""> <soap:Body> <GetMoviesResponse xmlns=""> <GetMoviesResult> <Movies xmlns=""> <Movie Title="10 Things I Hate About You" FilmID="474" /> <Movie Title="102 Dalmatians" FilmID="912" /> <Movie Title="13 Going on 30" FilmID="1496" /> <Movie Title="15 Minutes" FilmID="966" /> </Movies> </GetMoviesResult> </GetMoviesResponse> </soap:Body> </soap:Envelope>

Do you see anything wrong with the above? Would providing a snippet of the (long) data structure in $som be useful? Should I just run my head through a meat grinder instead? Inquiring minds want to know.

I'm using SOAP::Lite version 0.60.

Cross-posted to the SOAP::Lite mailing list.

Update: I've developed a workaround by setting $self->outputxml(1) and using XML::Simple to parse the data. I'd rather not do that but at least it works.


New address of my CGI Course.

In reply to SOAP::Lite Not returning expected results by Ovid

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2023-12-04 10:58 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (25 votes). Check out past polls.