RatArsed has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to develop a SOAP web service that's a little bit more useful than most of the samples seem to be (if I see one more 'hello world' example, I'll scream).

I'd also like to be able to consume this 'ere webservice from a .Net environment, as it will be a public API.

I'd like to be able to return a simple xml document. But at present, the only way I can see how to do this is to return a stringified version of the XML document, which seems absurd.

I've failed in my quest to find examples returning XML to be consumed, yet I can find plenty of consumers (grr!)

Does anyone have, or know of, some good examples that would fall into this category?

Edit: added below: I've got:

$retval = SOAP::Data->name('events'); foreach my $thisevt (keys %evtdbase) { $retval->value( SOAP::Data->name('event')->value( SOAP::Data->type +(string => $evtdbase{$thisevt} ) ) ); }
Now; this returns a single XML element. Hopefully it's obvious from the foreach that I'm trying to create something of the form:
<events> <event xsi:type="xsd:string">foo</event> <event xsi:type="xsd:string">bar</event> : : </events>
But instead, I'm getting just:
<event xsi:type="xsd:string">foo</event>

Replies are listed 'Best First'.
Re: Returning complex results from SOAP::Lite
by gellyfish (Monsignor) on May 26, 2005 at 15:25 UTC

    I think you want to create an array of your 'event' SOAP::Data objects - something like:

    my @events; foreach my $thisevt (keys %evtdbase) { push @events, SOAP::Data->name('event')->value( SOAP::Data->type(s +tring => $evtdbase{$thisevt} ) ); } $retval->value(@events);
    (Obviously untested.

    /J\