Good morning gurus! I am trying to automate and replace a process that we currently have which sends out information from an Excel spreadsheet written with VB code using a button to call a web service from one of our clients. I think I have it working but it only returns the code of "1 , 1" which Im sure it means that it errorred or failed (which I fully expect because Im using test data that they already have). How would I write it so that it will return the actual return message? Below is the code that I am using:
#!perl -w
use SOAP::Lite;
#use SOAP::Lite +trace => 'all';
use warnings;
use strict;
my $soap = SOAP::Lite
-> uri('http://tempuri.org/test/serv')
-> on_action( sub { join '/', 'tempuri.org/test/Serv', $_[1] } )
-> proxy('http://webserver.company.com/test/svc.asmx?wsdl');
my $method = SOAP::Data->name('wsm_Get_WMLead')
->attr({xmlns => 'http://tempuri.org/test/Serv/'});
my @params = ( SOAP::Data->name(str_UserName => "Manual"),
SOAP::Data->name(str_Password => "M*Post"),
SOAP::Data->name(str_TraceNumber => "19381120000000"),
SOAP::Data->name(str_FName => "QU"),
SOAP::Data->name(str_Minit => "D"),
SOAP::Data->name(str_LName => "TEALS"),
SOAP::Data->name(str_Address1 => "155 GRIFFIN LANE"),
SOAP::Data->name(str_City => "MANSFIELD"),
SOAP::Data->name(str_State => "CA"),
SOAP::Data->name(str_ZipCode => "96063"),
SOAP::Data->name(str_Phone => "5555534821"),
SOAP::Data->name(str_ACEID => "4108574"),
SOAP::Data->name(str_Center => "1938"),
SOAP::Data->name(str_NewCustDate => "20110214"),
SOAP::Data->name(str_PrinAmnt => "400.00"),
SOAP::Data->name(str_CompanyCode => "C01"),
SOAP::Data->name(str_ScriptNo => "") );
print $soap->call($method => @params)->result;
unless ($soap->fault) {
print $soap->result();
}
else {
print join ', ',
$soap->faultcode,
$soap->faultstring;
}
The script prints out "1 , 1"; I am assuming this is the faultcode and faultstring. I want to know what these value really means. How would I write it so I actually get the message rather than just the code? Thanks in advance.
-Paul