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

SOAP::Lite element order issue.

Expand Messages
  • Blaine Everingham
    Hi, I m trying to use SOAP::Lite to contact a web service. However, I can not get the parameters under the request element. Below is my sample code: my $wsdl =
    Message 1 of 1 , Jan 14, 2011
    • 0 Attachment
      Hi,

      I'm trying to use SOAP::Lite to contact a web service. However, I can not get the parameters under the request element.


      Below is my sample code:


      my $soap = SOAP::Lite
          -> service($wsdl);
      $soap->readable(true);

      my @params = ();
      push (@params, SOAP::Data->name( "locale" )->value( 'en_US' ) );
      push (@params, SOAP::Data->name( "hotelId" )->value( 134168 )->type('long'));
      push (@params, SOAP::Data->name( "wsMinorRev" )->value( 4 ));
      push (@params, SOAP::Data->name( "cid" )->value( 1 )->type('long'));

      $soap->getPropertyInformation(  @params  );


      Which produces:
        <soap:Body>
          <info:getPropertyInformation>
            <request xsi:nil="true" xsi:type="info:PropertyInformationRequest" />
            <hotelId xsi:type="xsd:long">134168</hotelId>
            <wsMinorRev xsi:type="xsd:int">4</wsMinorRev>
            <cid xsi:type="xsd:long">1</cid>
          </info:getPropertyInformation>
        </soap:Body>


      Note that the above code the request property is closed and the other elements are appended under the getPropertyInformation instead of under the request.



      Below is what I would like it to look like:
         <soap:Body>
            <info:getPropertyInformation soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
               <request xsi:type="info:PropertyInformationRequest">
                  <wsMinorRev xsi:type="com:WsMinorRevType" xmlns:com="http://common.xml.travelnow.com">4</wsMinorRev>
                  <cid xsi:type="xsd:long">1</cid>
                  <locale xsi:type="xsd:string">fr_FR</locale>
                  <hotelId xsi:type="xsd:long">161793</hotelId>
               </request>
            </info:getPropertyInformation>
         </soapenv:Body>


      All tips are welcome!

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