前几天我们完成了ABAP call SAP web service, 以及VB call SAP web service, 今天我们来实现Perl Call web service,其中perl用到的pakcage 为SOAP::Lite,关于SOAP::Lite,请参考CPAN的详细资料.
本文PDF文件:
Perl Call SAP Web Service (76.6 KiB, 412 hits)
Perl版本: Active Perl 5.8
SOAP::Lite: Active Perl安装包中自带
1. 在SAP端创建web service:
关于如何创建请参考:http://www.abaptech.com/2010/07/step-by-step-guide-sap-as-web-service-server/
这次例子我们用的web service:
我们用的函数如下:
2. 编写perl的代码:
Perl需要用到的package: SOAP::Lite
代码如下:
#!c:perl/bin/perl
use SOAP::Lite;
my $soap = SOAP::Lite
-> uri(‘urn:sap-com:document:sap:soap:functions:mc-style’)
-> proxy(‘http://<host>:<port>/sap/bc/srt/rfc/sap/zbobotest1/010/zbobotest1/zbobotest1′);
my $result = $soap->call(“Zbobotest001″);
print $result->result;
exit
3. 进行测试:
在命令行输入: Perl <file>.pl
<file> 内容为上面的代码
4. 测试结果:
No Comments