CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Help with SOAP::Lite request

 



islanderman
Novice

Apr 22, 2014, 2:48 PM

Post #1 of 1 (9150 views)
Help with SOAP::Lite request Can't Post

I've got the following xml output from a valid soap request that I need to convert to perl. I've created other soap requests successfully by adding the parameters but this is different in that there are attributes of xml elements that is creating a problem for me. This is the request.

<SendNotificationRequest clientIndicator="ISAAC_WFE" language="en" xsi:schemaLocation="http://edd.att.com/cnmeddservice EDD_Request.xsd" xmlns="http://edd.att.com/cnmeddservice" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ctype>TXT_TO_MGR</ctype>
<ctn category="contact">917523xxxx</ctn>
<data>
<dataField name="MgrID">jz359m</dataField>
<dataField name="SMSText">this is a test SMS message</dataField>
</data>
</SendNotificationRequest>


This does not work and I think its due to the 'category' and 'name' fields being an attribute of an xml element, not an element itself. So please let me know if this is anything close to what I needed.

$self->{method_name} = 'SendNotificationRequest';
$self->{method_attr} = {
"clientIndicator" => 'ISAAC_WFE',
"language" => "en",
"xsi:schemaLocation" => 'http://edd.att.com/cnmeddservice EDD_Request.xsd',
"xmlns" => 'http://edd.att.com/cnmeddservice',
"xmlns:xsi" => 'http://www.w3.org/2001/XMLSchema-instance',
"xmlns:cnm" => 'http://edd.att.com/cnmeddservice',
};

my $data = SOAP::Data->name($self->{method_name})->attr($self->{method_attr});
my @params = ( $data =>(
SOAP::Data->type("")->name('ctype' => 'TXT_TO_MGR'),
SOAP::Data->type("")->name('ctn')->attr({'category'})->value(SOAP::Data->value([
SOAP::Data->name('contact' => '917523xxxx')])),
SOAP::Data->type("")->name(data =>
\SOAP::Data->type('')->value(
SOAP::Data->type('')->name('dataField')->attr({'name'})->value(SOAP::Data->value([
SOAP::Data->name('MgrID' => 'jz359m')])),
SOAP::Data->type('')->name('dataField')->attr({'name'})->value(SOAP::Data->value([
SOAP::Data->name('SMSText' => 'this is a test SMS message')])),
))));
$self->{content} = $soap->call(@params);
$self->{request} = $soap->serializer->envelope(method => $data, @params);

$self->{content} = $soap->call(@params);

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives