X-DOC:SAP PO 接口配置完整教程之三REST服务发布&报文转换
- 1、SAP端RFC开发
- 2、PO端接口配置
- 2.1、PO端SLD配置
- 2.2、PO端ESB配置
- 2.3、PO端IB配置
- 2.4、Postman测试
- 3、报文转换配置
1、SAP端RFC开发
开发一个支持远程访问的RFC:
FUNCTION yfm_xl_rest_demo.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" VALUE(IV_CARRID) TYPE S_CARR_ID
*" VALUE(IV_FLDATE) TYPE S_DATE OPTIONAL
*" EXPORTING
*" VALUE(ES_RETURN) TYPE SCARR
*" TABLES
*" ET_DATA STRUCTURE SFLIGHT OPTIONAL
*"----------------------------------------------------------------------
SELECT SINGLE * FROM scarr WHERE carrid = @iv_carrid INTO @es_return.
SELECT * FROM sflight
WHERE carrid = @iv_carrid
AND ( @iv_fldate IS INITIAL OR ( @iv_fldate IS NOT INITIAL AND fldate GE @iv_fldate ) )
INTO TABLE @et_data.
ENDFUNCTION.
测试:
2、PO端接口配置
2.1、PO端SLD配置
2.2、PO端ESB配置
2.3、PO端IB配置
2.4、Postman测试
3、报文转换配置
回到ESB配置,添加转换报文,调整MM消息映射配置。
IB端配置
附:外部定义xsd文件
ED_XL_REST_DEMO_REQ.xsd
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xlevon.cn" targetNamespace="urn:xlevon.cn">
<xsd:element name="MT_XL_REST_DEMO_REQ" type="DT_XL_REST_DEMO_REQ" />
<xsd:complexType name="DT_XL_REST_DEMO_REQ">
<xsd:sequence>
<xsd:element name="carrier_id" type="xsd:string" minOccurs="0" />
<xsd:element name="flight_date" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
ED_XL_REST_DEMO_RES.xsd
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xlevon.cn" targetNamespace="urn:xlevon.cn">
<xsd:element name="MT_XL_REST_DEMO_RES" type="DT_XL_REST_DEMO_RES" />
<xsd:complexType name="DT_XL_REST_DEMO_RES">
<xsd:sequence>
<xsd:element name="header" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="carrier_id" type="xsd:string" minOccurs="0" />
<xsd:element name="carrier_name" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="body" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="list" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="carrier_id" type="xsd:string" minOccurs="0" />
<xsd:element name="connection_id" type="xsd:string" minOccurs="0" />
<xsd:element name="flight_date" type="xsd:string" minOccurs="0" />
<xsd:element name="PRICE" type="xsd:string" minOccurs="0" />
<xsd:element name="CURRENCY" type="xsd:string" minOccurs="0" />
<xsd:element name="PLANETYPE" type="xsd:string" minOccurs="0" />
<xsd:element name="SEATSMAX" type="xsd:string" minOccurs="0" />
<xsd:element name="SEATSOCC" type="xsd:string" minOccurs="0" />
<xsd:element name="PAYMENTSUM" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
原创文章,转载请注明来源-X档案