Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
MSIL
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 # remove the +trace => all to remove extensive output HTTP/SOAP traces\par
use SOAP::Lite +trace => all;\par
\par
# instantiate a soap client object\par
my $soap = SOAP::Lite\par
-> uri('https://ws2.sticomputer.com/LabVendorWeb/LabVendor.asmx')\par
-> on_action( sub \{ '"'.join('/', 'http://sticomputer.com/lab', $_[1]).'"' \} )\par
-> proxy('https://ws2.sticomputer.com/LabVendorWeb/LabVendor.asmx');\par
\par
# call the Ping() method\par
print "Calling Ping...\\n";\par
print $soap->Ping()->result;\par
print "done.\\n";\par
\par
# call the HelpAbout() method\par
print "Calling HelpAbout...\\n";\par
my $result = $soap->HelpAbout();\par
print $result->valueof('//HelpAboutResult' )."\\n";\par
print "done.\\n";\par
\par
# call the PutFile() method\par
print "Calling PutFile...\\n";\par
my $method = SOAP::Data->name('PutFile')\par
->attr(\{xmlns => 'http://sticomputer.com/lab'\});\par
\par
my @params = ( SOAP::Data->name(vendorID => 'ZZZ'), \par
SOAP::Data->name(vendorPassword => 'PASSWORD'),\par
SOAP::Data->name(fileData => 'File data goes here') );\par
\par
print $soap->call($method => @params)->result . "\\n";\par
print "done.\\n";\par
\par
<>; # pause\par
\par
\par
\par
}

When I run the above script, I receive the following errors:
D:\Perl>NEW.PL
Backslash found where operator expected at D:\Perl\new.pl line 1, near "rtf1\"
Backslash found where operator expected at D:\Perl\new.pl line 1, near "ansi\"
Backslash found where operator expected at D:\Perl\new.pl line 1, near "ansicpg1252\"
Backslash found where operator expected at D:\Perl\new.pl line 1, near "deff0\"
Backslash found where operator expected at D:\Perl\new.pl line 1, near "f0\"
Backslash found where operator expected at D:\Perl\new.pl line 1, near "froman\"
Bareword found where operator expected at D:\Perl\new.pl line 2, near "*\generator"
        (Missing operator before generator?)
Backslash found where operator expected at D:\Perl\new.pl line 2, near "viewkind4\"
Backslash found where operator expected at D:\Perl\new.pl line 2, near "uc1\"
Backslash found where operator expected at D:\Perl\new.pl line 2, near "pard\"
Backslash found where operator expected at D:\Perl\new.pl line 2, near "sb100\"
Backslash found where operator expected at D:\Perl\new.pl line 2, near "sa100\"
Backslash found where operator expected at D:\Perl\new.pl line 2, near "f0\"
syntax error at D:\Perl\new.pl line 1, near "rtf1\"
syntax error at D:\Perl\new.pl line 1, near "}}"
Execution of D:\Perl\new.pl aborted due to compilation errors.
D:\Perl>

I would appreciate, if someone could guide me to some resource, since I am new to perl and soap lite.
Posted
Updated 1-Feb-11 6:41am
v2

1 solution

If I'm not completely mistaken I think that the backslash is an escape character in Perl. So if you really mean to use it will have to escaped as well:
PERL
{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fswiss\\fcharset0 Arial;}}


From the look of the start of your file it seems as if your editor added some RTF tags to it. These richt text format tags mean nothing to the Perl interpreter and are absolutely superfluous. Please use another editor (I strongly recommend Notepad++) or make sure when you save your work with your editor to save in text file format only.

Best Regards,
Manfred
 
Share this answer
 
v3
Comments
Espen Harlinn 4-Feb-11 11:34am    
Sounds reasonable, 5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900