Perl/Soap Lite脚本 [英] Perl/soap lite script

查看:151
本文介绍了Perl/Soap Lite脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

{\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>


如果有人可以引导我获得一些资源,我将不胜感激,因为我是perl和soap lite的新手.


I would appreciate, if someone could guide me to some resource, since I am new to perl and soap lite.

推荐答案

soap = SOAP :: Lite \ par -> uri('https:// ws2.sticomputer.com/LabVendorWeb/LabVendor.asmx')\ par -> on_action( sub \ {'"
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 #调用 Ping()方法\ par 打印" ; \ par 打印
_[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()->结果; \ par 打印" ; \ par \ par #调用 HelpAbout()方法\ par 打印" ; \ par 我的
soap->Ping()->result;\par print "done.\\n";\par \par # call the HelpAbout() method\par print "Calling HelpAbout...\\n";\par my


这篇关于Perl/Soap Lite脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆