I'm trying to send raw XML to a wsdl service using SOAP::Lite.
Here's the relevant portion of my code:
use SOAP::Lite +trace => 'debug'; my $wsurl = 'http://xxxxxxxx.com/SVC/services/Service?wsdl'; my $svc = SOAP::Lite-> service($wsurl); $svc-> InsertData(@temparray);
This works BUT the angle brackets are getting escaped because the data type is set to string. To fix this I attempted to use SOAP::Data to set the type to XML like so:
use SOAP::Lite +trace => 'debug'; my $wsurl = 'http://xxxxxxxx.com/SVC/services/Service?wsdl'; my $svc = SOAP::Lite-> service($wsurl); my @xmldata = SOAP::Data->type('xml' => @temparray); $svc-> InsertData(@xmldata);
This results in an empty call to the service (no data). If I examine the resulting @xmldata with Data::Dumper I can see the data like so:
$VAR1 = bless( { '_type' => 'xml', '_signature' => [], '_value' => [ '<?xml version="1.0" encoding="UTF-8"?> +', '<Data1>', '<Data2>', etc... ], '_attr' => {} }, 'SOAP::Data' );
I'm pretty new at this web services stuff and I'd like to think that perl can do anything that Java/XMLSpy can do, but this is getting frustrating. I get the same results whether I sent the xml as an array or a long string.
Any help sending raw xml to a web service would be greatly appreciated. Thanks monks! Rob

In reply to SOAP::Lite, WSDLs and Raw XML Data by Ozeroc

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.