Step-by-Step Guide: Perl call SAP Web Service


前几天我们完成了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:

clip_image002

我们用的函数如下:

clip_image004

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. 测试结果:

clip_image006


About The Author

从事SAP行业有些年头,对SAP技术稍有了解; 如无特别声明,本博客文章为原创,转载请注明; 博主MSN:xuchunbo0901@hotmail.com; 博主邮箱:bob.xu@abaptech.com。

No Comments

Leave A Reply


注意: 评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。例如, ABC是本文的评论者之一,则使用'@ABC '(不包括单引号)将会自动将您的评论发送给ABC。使用'@all ',将会将评论发送给之前所有其它评论者。请务必注意user必须和评论者名相匹配(大小写一致)。

无觅相关文章插件,快速提升流量