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

In reply to SOAP LITE return message by NewMonk2Perl

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.