中间件接口攻略

标题虽然是攻略,实际是一个名称解释大全,我准备把我所了解的中间件技术都集中在这里。


第一个问题,什么是inbound和outbound?

SAP的中间件产品: 

XI(Exchange  Infrastructure),2002~2005
PI(Process Integration),2005~2012       
PO(Process Orchestration),2012~NOW

PO把SAP内部的开发接口暴露成WebService(其实ERP系统也是支持直接把接口暴露为WS),

通过各种adapter适配器接入其它系统。全球目前有25万个SAP ERP系统,有1万个SAP的XI/PI/PO系统。


SAP ERP系统中的接口:

BAPI:由SAP官方提供的函数库,并已经包含在ERP系统中,这些函数库有点类似WIN32 API,但处理的是各业务模块的功能和数据。,有了这些BAPI接口可以调用,ABAP不需要再重新去造轮子。所以SAP-ERP项目中大量自开发的程序都会调用这些接口,官方的BAPI几乎涉及了ERP的全业务域,程序也写得很完美,BAPI主要负责对业务数据得增、删、改;数据的展现和输入输出,ABAP开发人员只需在自己的程序中完善即可。所以很多自开发的程序,你可以看到在外围的代码是自己写的,但核心的数据操作都会依赖BAPI来实现,这样及快又好。

RFC:通常这些函数都是开发人员自己开发的,ABAP开发人员把接口功能要处理的逻辑都在RFC中来实现,然后这些RFC都有输入,输出,表;这些参数可以和调用的外围程序完成数据交互。RFC是SAP实现接口最简单的方式。SAP官方提供了外围平台的类库NCO和JCO,把SAP的RFC延申到.net和java平台,并且这类库很稳定(支持掉线重连),在接口开发这一层,这些类库提供了很全的功能,也很好用,唯一的缺点是配套的例子代码还不够全面。


关于接口的inboundoutbound方式的解释(有别于MM业务上说的外向交货和内向交货),

我们可以从SAP,ORACLE,IBM官方的资料查到如下

SAP官方HELP:

The SAP Java Connector (SAP JCo) is a middleware component that enables the development of SAP-compatible components and applications in Java. SAP JCo supports communication with the SAP Server in both directions: inbound (Java calls ABAP) and outbound calls (ABAP calls Java).

而Oracle® Fusion Middleware文档是这样描述:
《Integration Adapter for SAP R/3 User's Guide for Oracle WebLogic Server 12c Release (12.2.1.3.0)》

The Adapter for SAP is used for the integration of Oracle products with SAP Enterprise to exchange the real-time data. It is developed in the Oracle JCA framework. It is based on the SAP Java Connector 3.0 (SAP JCo) and is used for the inbound and outbound interaction with SAP using message types RFC/BAPI/IDOC.
Outbound interaction: When an application uses the Adapter for SAP to invoke an SAP R/3 business object or business operation, the interaction is termed as Outbound interaction.
Inbound interaction: When an SAP R/3 system triggers an event and the event is listened by an application using Adapter for SAP as a result of which the application receives SAP R/3 data, the interaction is termed as Inbound interaction.
Adapter for SAP allows different types of connection methods including secure connection and message server communication method, with both Unicode and Non-unicode SAP systems.


SAP的outbound等于OSB的inbound(JCO的SAP官网例子代码为StepByStepServer.java)

可以这样理解:从自己的系统发起的接口传输定义为Outbound,外部发起对我的调用定义为Inbound。



IBM Integration Bus 总线产品相关描述:

《Technical overview of Adapter for SAP Software 10》

WebSphere® Adapter for SAP Software provides multiple ways to interact with applications and data on SAP servers. Outbound processing (from an application to the adapter to the SAP server) and inbound processing (from the SAP server to the adapter to an application) are supported.
WebSphere Adapter for SAP Software connects to SAP systems running on SAP Web application servers. The adapter supports Advanced Event Processing (AEP) and Application Link Enabling (ALE) for inbound processing, and the Business Application Programming Interface (BAPI), AEP, ALE, and Query Interface for SAP Systems (QISS) for outbound processing. You set up the adapter to perform outbound and inbound processing by using the Adapter Connection wizard to generate business objects based on the services it discovers on the SAP server.

For outbound processing, the adapter client invokes the adapter operation to create, update, or delete data on the SAP server or to retrieve data from the SAP server.
For inbound processing, an event that occurs on the SAP server is sent from the SAP server to the adapter. The ALE inbound and BAPI inbound interfaces start event listeners that detect the events. Conversely, the Advanced event processing interface polls the SAP server for events. The adapter then delivers the event to an endpoint, which is an application or other consumer of the event from the SAP server.
You configure the adapter to perform outbound and inbound processing by using the Adapter Connection wizard to create a library that includes the interface to the SAP application as well as business objects based on the functions or tables that it discovers on the SAP server.

Overview of the outbound processing interfaces
WebSphere Adapter for SAP Software provides multiple interfaces to the SAP server for outbound processing.
Through its BAPI interfaces, the adapter issues remote function calls (RFCs) to RFC-enabled functions, such as a Business Application Programming Interface (BAPI) function. These remote function calls create, update, or retrieve data on an SAP server.
The BAPI interface works with individual BAPIs (simple BAPIs). For example, you might want to check to see whether specific customer information exists in an SAP database.
The BAPI work unit interface works with ordered sets of BAPIs. For example, you might want to update an employee record. To do so, you use three BAPIs:
To lock the record (to prevent any other changes to the record)
To update the record
To have the record approved
The BAPI result set interface uses two BAPIs to select multiple rows of data from an SAP database.
BAPI calls are useful when you need to perform data retrieval or manipulation and a BAPI or RFC function that performs the task already exists.
Simple BAPIs can be sent through the synchronous RFC, asynchronous transactional RFC, or asynchronous queued RFC protocol.
With synchronous RFC, both the adapter and the SAP server must be available when the call is made from the adapter to the SAP server. The adapter sends a request to the SAP server and waits for a response.
With asynchronous transactional RFC, a transaction ID is associated with the call from the adapter to the SAP server. The adapter does not wait for a response from the SAP server. Only the transaction ID is returned to the message flow.
With asynchronous queued RFC, the call from the adapter is delivered to a predefined queue on the SAP server. As with asynchronous RFC, a transaction ID is associated with the call, and the adapter does not wait for a response from the SAP server.
This interface is useful when the event sequence must be preserved.
The Query interface for SAP Software retrieves data from specific SAP application tables. It can return the data or check for the existence of the data. You can use this type of interaction with SAP if you need to retrieve data from an SAP table without using an RFC function or a BAPI.
With the Application Link Enabling (ALE) interface, you exchange data using SAP Intermediate Data structures (IDocs). For outbound processing, you send an IDoc or a packet of IDocs to the SAP server.
The ALE interface, which is particularly useful for batch processing of IDocs, provides asynchronous exchange. You can use the queued transactional (qRFC) protocol to send the IDocs to a queue on the SAP server. The qRFC protocol ensures the order in which the IDocs are received. It is often used for system replications or system-to-system transfers.
With the ALE pass-through IDoc interface, the adapter sends the IDoc to the SAP server with no conversion of the IDoc. The message tree contains a BLOB field that represents the IDoc.
With the Advanced event processing interface, you send data to the SAP server. The data is then processed by an ABAP handler on the SAP server.

Overview of the inbound processing interfaces
WebSphere Adapter for SAP Software provides the following interfaces to the SAP server for inbound processing.
Through its BAPI inbound interface, the adapter listens for events and receives notifications of RFC-enabled function calls from the SAP server.
With synchronous RFC, both the adapter and the SAP server must be available when the call is made from the SAP server to the adapter. The adapter sends the request to a predefined application and returns the response to the SAP server.
With asynchronous transactional RFC, the event is delivered to the adapter even if the adapter is not available when the call is made. The SAP server stores the event on a list of functions to be invoked and continues to attempt to deliver it until the adapter is available.
You also use asynchronous transaction RFC if you want to deliver the functions from a predefined queue on the SAP server. Delivering the files from a queue ensures the order in which the functions are sent.
If you select assured once-only delivery, the adapter uses a data source to persist the event data received from the SAP server. Event recovery is provided to track and recover events in case a problem occurs when the adapter attempts to deliver the event to the endpoint.
With the ALE inbound processing interface, the adapter listens for events and receives one or more IDocs from the SAP server. As with ALE outbound processing, ALE inbound processing provides asynchronous exchange.
You can use the qRFC interface to receive the IDocs from a queue on the SAP server, which ensures the order in which the IDocs are received.
If you select assured once-only delivery, the adapter uses a data source to persist the event data, and event recovery is provided to track and recover events in case a problem occurs when the adapter attempts to deliver the event to the endpoint.
With the ALE pass-through IDoc interface, the SAP server sends the IDoc through the adapter to the endpoint with no conversion of the IDoc. The message tree contains a BLOB field that represents the IDoc.
The Advanced event processing interface polls the SAP server for events. It discovers events waiting to be processed. It then processes the events and sends them to the endpoint. For more information, see The Advanced event processing interface.


上面资料总结:

中间件的inbound方式定义为SAP call ESB;outbound方式定义为ESB call SAP .


TO BE。。。。






猜你喜欢

转载自blog.csdn.net/ot512csdn/article/details/80675706