转:SAP WEB Service
来源:互联网 发布:网络视频下载神器 编辑:程序博客网 时间:2024/06/06 11:47
转自:http://bbs.vsharing.com/Article.aspx?aid=727349
SAP WEB Service
创建 Web ServicesSAP
sap Web Services
Web service 就是一个应用程序,它向外界暴露出一个能够通过Web进行调用的API。也就是说,可以利用编程的方法通过Web来调用这个应用程序。
Web services是建立可互操作的分布式应用程序的新平台。Web service平台是一套标准,它定义了应用程序如何在Web上实现互操作性。你可以用任何你喜欢的语言,在任何你喜欢的平台上写Web service ,只要我们可以通过Web service标准对这些服务进行查询和访问。
SAP 的Web Service 分为ABAP and Java Web Services。
创建Web Service
方法1.T-Code:SE80 选择Package,然后右击在菜单中选择,Create®Enterprise Services / Web Services ® Web Service.
方法2.T-CODE :SE37 选择一个function module,显示,菜单,Utilities®More Utilities®Create Web Service® From the Function Moduleor From the Function Group
方法3.T-CODE:BAPI BAPI Explorer
在创建Web service 时,首先要创建Virtual interfaces
Virtual interfaces
Web service 就是一个应用程序,它向外界暴露出一个能够通过Web进行调用的API。也就是说,可以利用编程的方法通过Web来调用这个应用程序。
Web services是建立可互操作的分布式应用程序的新平台。Web service平台是一套标准,它定义了应用程序如何在Web上实现互操作性。你可以用任何你喜欢的语言,在任何你喜欢的平台上写Web service ,只要我们可以通过Web service标准对这些服务进行查询和访问。
SAP 的Web Service 分为ABAP and Java Web Services。
创建Web Service
方法1.T-Code:SE80 选择Package,然后右击在菜单中选择,Create®Enterprise Services / Web Services ® Web Service.
方法2.T-CODE :SE37 选择一个function module,显示,菜单,Utilities®More Utilities®Create Web Service® From the Function Moduleor From the Function Group
方法3.T-CODE:BAPI BAPI Explorer
在创建Web service 时,首先要创建Virtual interfaces
Virtual interfaces
Using virtual interfaces, you can define several views of an implementation and publish these separately as a Web service. When you create virtual interfaces, you can rename or hide operations and parameters. You can also define standard values for parameters and convert parameter types.
创建Virtual interfaces
T-CODE:SE80 选择Package 右击:Create®Enterprise Service / Web Service®Virtual Interface
Release Web Service
T-CODE:WSConfig
选择web service Service Definition ,Variant ,
创建 release web service.
保存后列表中会出现已release 的web service.
生成WSDL
T-CODE:WSADMIN
执行(Ctrl+F8),生成WSDL(Web Services Description Language)(Ctrl+F9)
服务管理
T-CODE:sicf 管理SAP服务(包含web service)
服务监控:
T-Code:smicm 服务监控
创建Virtual interfaces
T-CODE:SE80 选择Package 右击:Create®Enterprise Service / Web Service®Virtual Interface
Release Web Service
T-CODE:WSConfig
选择web service Service Definition ,Variant ,
创建 release web service.
保存后列表中会出现已release 的web service.
生成WSDL
T-CODE:WSADMIN
执行(Ctrl+F8),生成WSDL(Web Services Description Language)(Ctrl+F9)
服务管理
T-CODE:sicf 管理SAP服务(包含web service)
服务监控:
T-Code:smicm 服务监控
SAP.NET 实现 XI SOAP Sender
SAP.NET可以实现与SAP系统的IDOC,FM,BAPI,RFC ,web service方式的连接,进行交互,其中web service是未来SAP与外界进行交互技术发展的趋势,也是ESOA的实现之一。
开发步骤:
这个实例使用BAPI_USER_GET_DETAIL 做为receiver interface 和用户定义outbound 同步interface。
创建response message mapping 。
创建interface mapping 。
创建sender communication channel 类型是SOAP adapter ,使用outbound synchronous interface
创建 receiver communication channel
创建receiver determination
在ID端定义web service,创建WSDL outbound synchronous ,URL http://host:port/XISOAPAdapter/MessageServlet?channel=party:service:channel
在.net 开发环境下加入web 引用,可以用本地文件,或者远程URL。
编译后会生成CS的类文件,关于sap.net 的应用可以查看sap.net安装后的DEMO,很好,很强大。
开发步骤:
这个实例使用BAPI_USER_GET_DETAIL 做为receiver interface 和用户定义outbound 同步interface。
创建response message mapping 。
创建interface mapping 。
创建sender communication channel 类型是SOAP adapter ,使用outbound synchronous interface
创建 receiver communication channel
创建receiver determination
在ID端定义web service,创建WSDL outbound synchronous ,URL http://host:port/XISOAPAdapter/MessageServlet?channel=party:service:channel
在.net 开发环境下加入web 引用,可以用本地文件,或者远程URL。
编译后会生成CS的类文件,关于sap.net 的应用可以查看sap.net安装后的DEMO,很好,很强大。
一、生成webservice
1、向导创建:SE37, Utilities -> More Utilities -> Create Web Service -> From the Funtion Module
2、或者: SE80, 在Package的右键菜单中选择:Create -> Enterprise Service / Web Service -> Web Service
3、详细配置:SE80
4、运行环境配置:WSCONFIG
5、Web Servie Administration for SOAP Runtime: WSADMIN, 在这里可以做webservice的测试,查看WSDL
二、调用webservice
1、创建RFC连接: SM50, 类型为HTTP Connection to External Serv,可以设置登录用户和口令
2、创建Logical Port: LPCONFIG, 其中HTTP Destination 选择上一步创建的RFC连接,Path Prefix选择WSDL路径中的后半部分,保存后Active
3、修改调用程序使用的Package, 增加两个Use Access, SAI_TOOLS和SAPPINT, Error Severity都选择No Response
4、生成代理对象: SE80,在Enterprise Services节点的右键菜单中选择: Create -> Proxy Object, WSDL Soruce选择URL / HTTP Destination, 输入WSDL的地址就可以了
5、写调用代码,生成一个代理对象的实例,再调用它的方法就可以了,下面是一个简单的例子:
REPORT z_ws_call_test.
DATA: proxy TYPE REF TO zco_z_get_org,
org_in TYPE zzget_org,
org_out TYPE zzget_org_response,
error type REF TO cx_ai_system_fault.
org_in-orgname = 'SORG.1000'.
TRY.
CREATE OBJECT proxy
* EXPORTING
* LOGICAL_PORT_NAME =
.
*TRY.
CALL METHOD proxy->zget_org
EXPORTING
input = org_in
IMPORTING
output = org_out.
* CATCH CX_AI_SYSTEM_FAULT .
* CATCH CX_AI_APPLICATION_FAULT .
*ENDTRY.
CATCH cx_ai_system_fault INTO error.
WRITE /1 error->ERRORTEXT.
ENDTRY.
WRITE: AT /1 org_in-orgname,
/1 org_out-orgcode.
Building Web Services with ABAP and SAP Web Application Server.pdf ( 1376 KB )
- 转:SAP WEB Service
- SAP调用外部web service
- SAP调用外部web service
- SAP调用外部web service
- SAP调用外部web service
- SAP调用外部web service
- SAP SOAMANAGER 配置Web Service
- SAP调用外部web service
- 转: Calling a SAP Web Service from VS.Net
- SAP 发送 HTTP POST(Web Service)
- SAP Web Service 出现Http 500 异常
- 配置SAP ECC直接调用外部系统的Web Service
- SAP调用外部 Web Service step by step
- SAP创建Web Service以及用ABAP调用
- SAP创建Web Service以及用ABAP调用
- 转: SAP WEB DYNPRO ebooks
- [转] 什么是Web Service?
- [转]Web Service入门
- 关于html:select
- 表达式计算器的核心代码
- Date2String & String2Date
- SQLite3 与 NHibernate 在 .NET 程序中使用
- Berkeley DB——Store Structure 如何存储结构体
- 转:SAP WEB Service
- CIO的疑虑:信息化项目对企业有用吗?
- 双机备份,救了客户的命.
- 向Flash中烧写uboot和linux操作系统
- NET委托:一个C#睡前故事
- ERP系统模块完全解析──物料需求综述
- 使用 sed 编辑器
- 使用存储过程向MySQL批量插入数据
- ERP系统模块完全解析──生产排程综述