hi, I am using SOAP::lite and the module from the stubmaker.pl to invoke SOAP APIs from WSDL. my original/desired SOAP request looks like the following ==============================
<?xml version = "1.0" encoding = "UTF-8" ?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envel +ope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <USER soapenv:mustUnderstand="0" xsi:type="xsd:string">admin</USER +> <PASSWORD soapenv:mustUnderstand="0" xsi:type="xsd:string">admin</ +PASSWORD> <SYSTEMUSER soapenv:mustUnderstand="0" xsi:type="xsd:string"/> </soapenv:Header> <soapenv:Body> <ns1:getNewGroup xmlns:ns1="http://www.xyznet.com/sms/smsapi/r08_00/NewGroupService" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <in0 href="#id0"/> <in1 href="#id1"/> </ns1:getNewGroup> <multiRef xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/ +" xmlns:ns2="http://www.xyznet.com/sms/smsapi/r08_00/model" id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:NewGroupKey"> <internalId xsi:type="xsd:string">16789900</internalId> </multiRef> <multiRef xmlns:ns3="http://www.xyznet.com/sms/smsapi/r08_00/model +" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:PartKey"> <internalId xsi:type="xsd:string">15</internalId> <name xsi:type="xsd:string" xsi:nil="true"/> </multiRef> </soapenv:Body> </soapenv:Envelope>
My Perl module from stubmaker.pl that contains the above section looks like the following =================================================================
my %methods = ( getNewGroup => { endpoint => 'http://10.3.1.5/smsapi/services/SMSAPI/r08_00/NewGrou +pService', soapaction => '', namespace => 'http://www.xyznet.com/sms/smsapi/r08_00/NewGroupServ +ice', parameters => [ SOAP::Data->new(name => 'in0', type => 'tns1:PartKey', attr => { +}), SOAP::Data->new(name => 'in1', type => 'tns1:NewGroupKey', attr +=> {}), ], # end parameters }, # end getNewGroup
I need pass the "attr" value for the above SOAP::Data hash entry, how shall I achieve this?? also the how shall I include my auth header permanantly? Following is the perl file that I am using to call the above method from the stub =========================================================
use SOAP::Lite +trace => 'debug'; use Data::Dumper; use SMSAPIService_r08_00_NewGroupService qw(:all); my $headers = SOAP::Header->name("authenticate" => SOAP::Header->value(SOAP::Header->name("USER" => "admin"), SOAP::Header->name("PASSWORD" => "admin") ) ); my $obj = new SMSAPIService_r08_00_NewGroupService; $obj -> use_prefix(1); $obj->readable(1); $obj->want_som(1); $obj->getNewGroup($headers,15,16789900);
Among many of my attempt I am unable to construct the request body as desired by my server, it always sets the body as follows
<soap:Body> <impl:getNewGroup> <in0 xsi:nil="true" xsi:type="tns1:PartKey" /> </impl:getNewGroup> </soap:Body>
I am not finding how to pass the attributes to the stub so that it can construct the request as desired by my server. Request for a push to keep me going :( thanks, Naresh

In reply to soap lite and stubmaker by lazyreader

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.