Re: Returning raw xml in SOAP::Lite



Mark wrote:

Dear Perl folks,

Using Perl 5.8.7 and SOAP::Lite 0.69, consider please this small example
from perl.com:

-----------------
#!perl -w

use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
-> dispatch_to('Demo')
-> handle;

package Demo;

sub hi {
return "hello, world";
}

sub bye {
return "goodbye, cruel world";
}
-----------------

Now, I got SOAP service set up like that. But what I want, instead of,
say, return ("goodbye, cruel world");, is to return a RAW xml stream,
complete with xml envelope and all (the xml is generated in another
place), and parse that straight back to the client.

Now, I tried several things; like setting outputxml => 1. Or this:

$xml = SOAP::Data->type('xml' => $raw);
return ($xml);

(and yes, $raw is defined within the "Demo" package). But the result is
always the same: SOAP::Lite returns an empty SOAP envelope. For the life
of me I just cannot get SOAP::Lite to just output my raw data to the
client.

I am kinda new to SOAP, and quite obviously missing something. If someone
has any ideas, I'll be glad to hear them.


Without having tried it myself looks like you want to override the
serializer method to be able to create your own envelopes. Consider
taking a look at this:-

http://cookbook.soaplite.com/#changing%20method%20name%20in%20response

Thanks,

- Mark

Thank You,
++imanshu.

.



Relevant Pages

  • Returning raw xml in SOAP::Lite
    ... sub bye { ... say, return;, is to return a RAW xml stream, ... $raw is defined within the "Demo" package). ...
    (comp.lang.perl.misc)
  • Re: Returning raw xml in SOAP::Lite
    ... sub bye { ... I got SOAP service set up like that. ... say, return;, is to return a RAW xml stream, ...
    (comp.lang.perl.misc)
  • CRAP CODE CHRONICLES: Xml
    ... this will be painfull for all the XML experts here on this board. ... sub original_content ... # call new_parse handler ... # call start tag handler with $2 ...
    (comp.lang.perl.misc)
  • Re: Conditional referencing/If values
    ... XML file containing the data and then pull the informatin from there. ... Sub AutoNew() ... Dim oDoc As Word.Document ... Unless I'm not understanding the AutoText feature correctly, ...
    (microsoft.public.word.docmanagement)
  • Re: Conditional referencing/If values
    ... based on what I just read about XML... ... Sub AutoNew() ... Dim oDoc As Word.Document ... Unless I'm not understanding the AutoText feature correctly, ...
    (microsoft.public.word.docmanagement)