I'm attempting to construct a SOAP request with SOAP::Lite and running into a problem. The request should look like this when it arrives at the server:

<?xml version="1.0" encoding="UTF-8" ?> - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/env +elope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http: +//www.w3.org/2001/XMLSchema-instance"> - <soapenv:Body> - <ns1:edfSubmit soapenv:encodingStyle="http://schemas.xmlsoap.org/soa +p/encoding/" xmlns:ns1="http://www.n-able.com/schemas/EDF/1.0"> <arg1 xsi:type="xsd:string">ABCDEFG1234</arg1> - <arg2 xsi:type="soapenc:Array" soapenc:arrayType="xsd:anyType[1]" xm +lns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <item href="#id0" /> </arg2> </ns1:edfSubmit> - <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://sc +hemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:T_EDFData" xmlns:soap +enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://Def +aultNamespace"> <delayToSend xsi:type="xsd:int">10</delayToSend> <errorMessage xsi:type="xsd:string" /> <jobID xsi:type="xsd:string">2</jobID> - <values xsi:type="soapenc:Array" soapenc:arrayType="xsd:anyType[3]"> <item href="#id1" /> <item href="#id2" /> <item href="#id3" /> </values> </multiRef> - <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://sc +hemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:T_EDFValues" xmlns:ns +3="http://DefaultNamespace" xmlns:soapenc="http://schemas.xmlsoap.org +/soap/encoding/"> <scanDetail xsi:type="xsd:string">detail2</scanDetail> <value xsi:type="xsd:string">value2</value> </multiRef> - <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://sc +hemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:T_EDFValues" xmlns:ns +4="http://DefaultNamespace" xmlns:soapenc="http://schemas.xmlsoap.org +/soap/encoding/"> <scanDetail xsi:type="xsd:string">detail1</scanDetail> <value xsi:type="xsd:string">value1</value> </multiRef> - <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://sc +hemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:T_EDFValues" xmlns:ns +5="http://DefaultNamespace" xmlns:soapenc="http://schemas.xmlsoap.org +/soap/encoding/"> <scanDetail xsi:type="xsd:string">detail3</scanDetail> <value xsi:type="xsd:string">value3</value> </multiRef> </soapenv:Body> </soapenv:Envelope>

Not all of this is important, only the fact that edfSubmit and multiRef are separate body parts in this request. I am attempting to use the following code to construct the request:

my $sl = SOAP::Lite ->uri("http://backup.united-systems.com") ->proxy("http://backup.united-systems.com/rpctest.pl"); my @headers = (SOAP::Data->name('edfSubmit')->attr({'ns1' => 'http://w +ww.n-able.com/schemas/EDF/1.0'})); my @data = (SOAP::Data->name('multiRef')->type('ns2:T_EDFData')); $sl->call('edfSubmit', @headers, @data);

Using the above code makes multiRef a child of edfSubmit. Is there any way to get around this using SOAP::Lite, or do I need to use some other SOAP class to properly construct this?


In reply to Constructing a SOAP request by dirtdart

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.