lazyreader has asked for the wisdom of the Perl Monks concerning the following question:

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