I am trying to write a very simple client to a web service. There is one service I need to call that accepts 4 input strings and returns one. From the wsdl of the service:
- <complexType name="submitToRemedyForm"> - <sequence> <element name="String_1" nillable="true" type="string" /> <element name="String_2" nillable="true" type="string" /> <element name="String_3" nillable="true" type="string" /> <element name="String_4" nillable="true" type="string" /> </sequence> </complexType>
I am using this code:
use SOAP::Lite +trace => debug; my $service = SOAP::Lite->service('https://remabsintcert/remedyAbstrac +tService/remedyAbstractService_1_0?wsdl'); print $service->submitToRemedyForm( SOAP::Data->name(String_1 => 'login'), SOAP::Data->name(String_2 => 'password'), SOAP::Data->name(String_3 => 'form'), SOAP::Data->name(String_4 => 'xxxxxxx'), );
According to the debug output, the SOAP xml is missing the String_1 value and adding some other tag. Here is the output cleaned up a little.
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:ns2="http://xxx.com/remedyAbstractService_1_0/typ +es" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xm +lns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="h +ttp://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.or +g/2001/XMLSchema-instance" xmlns:tns="http://xxx.com/remedyAbstractSe +rvice_1_0/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <tns:submitToRemedyForm> <submitToRemedyForm xsi:nil="true" xsi:type="tns:submitToRemedyFor +m" /> <String_2 xsi:type="xsd:string">password</String_2> <String_3 xsi:type="xsd:string">form</String_3> <String_4 xsi:type="xsd:string">xxxxxxx</String_4> </tns:submitToRemedyForm> </soap:Body></soap:Envelope>
I'm getting a client error when I try to run the code. I was able to submit the request from a different app (soapUI) and it returns the expected response so I know the service is working properly. Soap::Lite seems to be doing things to the formatting and structure to cause errors. A working request looks like:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envel +ope/" xmlns:typ="http://xxx/remedyAbstractService_1_0/types"> <soapenv:Header/> <soapenv:Body> <typ:submitToRemedyForm> <String_1>login</String_1> <String_2>password</String_2> <String_3>form</String_3> <String_4>xxxxxx</String_4> </typ:submitToRemedyForm> </soapenv:Body> </soapenv:Envelope>
What do I have to do to Soap::Lite to get it to create a request that looks like the working one? Thanks!

In reply to Confusing results from Soap Lite by Dale1990

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.