I'm new to SOAP::Lite and could use some help. I want to create a soap message containing an xml-file like this.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wkpb-stuf="http://www.vrom.nl/wkpb/stuf" xmlns:StUF="http://www.egem.nl/StUF/StUF0205" xmlns:wkpb="http://www.vrom.nl/wkpb0102" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> ..................content of xml file................... </soapenv:Body> </soapenv:Envelope>
The code I have thus far is:
use SOAP::Lite +trace => "all"; my $ser = SOAP::Serializer->new(); $ser-> register_ns ("http://www.egem.nl/StUF/StUF0205", "StUF"); $ser-> register_ns ("http://www.vrom.nl/wkpb0102", "wkpb"); $ser-> register_ns ("http://www.vrom.nl/wkpb/stuf", "wkpb-stuf"); my $method = SOAP::Data -> prefix ('wkpb-stuf') ; my $soap = SOAP::Lite -> serializer ($ser) -> readable (1) -> proxy ($ep) -> call ($method => SOAP::Data->type('xml' => $aanvraag)) ;
Resulting in the following:
<soap:Envelope xmlns:wkpb-stuf="http://www.vrom.nl/wkpb/stuf" xmlns:StUF="http://www.egem.nl/StUF/StUF0205" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wkpb="http://www.vrom.nl/wkpb0102" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <wkpb-stuf:c-gensym2> ..................content of xml file................... </wkpb-stuf:c-gensym2> </soap:Body> </soap:Envelope>
So I'm almost there but how can I get rid of the c-gensym2 elements? -- Henry

In reply to SOAP::Lite and raw xml by Henry

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.