Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] How to send and raw XML.

Expand Messages
  • Byrne Reese
    To package raw XML in a SOAP::Data element, simply: my $xml_content = fetch($url); $xml_content =~ s/ n?//; # strip the $xml_content
    Message 1 of 3 , May 20, 2003
    • 0 Attachment
      To package raw XML in a SOAP::Data element, simply:

      my $xml_content = fetch($url);
      $xml_content =~ s/\<\?xml.*\?\>\n?//; # strip the <?xml blah?>
      $xml_content =~ s/\<\!.*\>\n?//; # strip
      return SOAP::Data->type('xml' => $xml_content);

      In the above case I was dealing with a complete document, so I had to
      first strip the parts of the xml document I didn't need. Once that was
      done, just set the type to 'xml' and the value to your document...
      SOAP::Lite will do the rest.

      As always - the answer (and in this case the complete answer since there
      is a lot of somewhat irrelevant background) can also be found at the
      SOAP::Lite Solutions blog:

      http://www.majordojo.com/archives/2003_05.html#000017


      On Tue, 2003-05-20 at 00:30, kopetnik wrote:
      > How to send through SOAP::Lite a message instead of calling remote
      > subroutine? Just to put some XML into envelope - <soap-env:Body>
      > and send it to server. The same with server - receive pure XML message
      > and response with
      > another XML message.
      >
      > I can't find any solution in the docs.
      >
      > --
      > Thanks in advance for an answer, regards,
      > Lech
      >
      >
      > Yahoo! Groups Sponsor
      > ADVERTISEMENT
      > Click Here for a Quote!
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      --
      Byrne Reese
      Developer Program Manager
      Grand Central Communications
    • Jim Cromie
      I think that should be: $xml_content =~ s/ n?//; # strip the $xml_content =~ s/ n?//; # strip .*? is non-greedy - if youre
      Message 2 of 3 , May 20, 2003
      • 0 Attachment
        I think that should be:
         
        $xml_content =~ s/<\?xml.*?\?>\n?//; # strip the <?xml blah?>
        $xml_content =~ s/<!.*?>\n?//;      # strip

        .*? is non-greedy - if youre operating on a whole-file buffer this could
        be important, but testing would tell you that youve deleted large chunks of your content.
         
        <>! are not special inside a regex, and dont need escaped.

        Byrne Reese <breese@...> wrote:
        To package raw XML in a SOAP::Data element, simply:

                my $xml_content = fetch($url);
                $xml_content =~ s/\<\?xml.*\?\>\n?//; # strip the <?xml blah?>
                $xml_content =~ s/\<\!.*\>\n?//;      # strip
                return SOAP::Data->type('xml' => $xml_content);


        Do you Yahoo!?
        The New Yahoo! Search - Faster. Easier. Bingo.

      Your message has been successfully submitted and would be delivered to recipients shortly.