bear0053 has asked for the wisdom of the Perl Monks concerning the following question:
notice there are name spaces in the above xml. i cannot seem to be able to successfully create a call that is accepted by the server to mimic what is shown above. the code i am using (at least the current try) is:<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope> <SOAP-ENV:Body> <typens:newAccount xmlns:typens="urn:HELP"> <primary xsi:type="typens:LoginInfo"> <username xsi:type="xsd:string">myusername</username> <password xsi:type="xsd:string">mypwd</password> + </primary> <securityid xsi:type="xsd:string">123456789</securityid> <personalinfo xsi:type="typens:PersonalInfo"> <pin xsi:type="xsd:string">1554</pin> <street xsi:type="xsd:string">123 test st</street> <contact xsi:type="xsd:string">John Down</contact> </personalinfo> </typens:newAccount> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
==================UPDATE===================$SendObject = SOAP::Lite -> service('https://mydomain.com/filname.wsdl') -> uri('https://mydomain.com/server.php'); $response = $SendObject -> newDomain( SOAP::Data->name('username' => ' +myusername'), SOAP::Data->name('password' => 'mwowd'), SOAP::Data->name('securityid' => '123456789'), SOAP::Data->name('pin' => '1554'), SOAP::Data->name('street' => '123 street'), SOAP::Data->name('contact' => 'John Doe') + );
$response will contain the raw xml response from the service call and you will be able to parse that using XML::Simple or whatever you need to do with it.my $xml = '<primary xsi:type="typens:LoginInfo"> <username xsi:type="xsd:string">myusername</username> <password xsi:type="xsd:string">mypwd</password> + </primary> <securityid xsi:type="xsd:string">123456789</securityid> <personalinfo xsi:type="typens:PersonalInfo"> <pin xsi:type="xsd:string">1554</pin> <street xsi:type="xsd:string">123 test st</street> <contact xsi:type="xsd:string">John Down</contact> </personalinfo>'; my $response= SOAP::Lite -> service('https://mydomain.com/service.wsdl') + -> outputxml(1) -> newAccount( SOAP::Data->type('xml' => $xml) ); print $response;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to send a request with soap::lite
by jesuashok (Curate) on Jan 12, 2006 at 10:07 UTC | |
by bear0053 (Hermit) on Jan 12, 2006 at 18:50 UTC |