how to set up a web-service-related scenario with sap xi

24
How-to Guide SAP NetWeaver ‘04 How To… Set Up a Web- Service- Related Scenario with SAP XI Version 1.10 – March 2005 Applicable Releases: SAP NetWeaver ’04 SAP Exchange Infrastructure 3.0 SP9

Upload: ginf33

Post on 13-Apr-2015

50 views

Category:

Documents


3 download

DESCRIPTION

How to Set Up a Web-Service-Related Scenario With SAP XI

TRANSCRIPT

Page 1: How to Set Up a Web-Service-Related Scenario With SAP XI

How-to Guide SAP NetWeaver ‘04

How To… Set Up a Web-Service-Related Scenario with SAP XI Version 1.10 – March 2005 Applicable Releases: SAP NetWeaver ’04 SAP Exchange Infrastructure 3.0 SP9

Page 2: How to Set Up a Web-Service-Related Scenario With SAP XI

© Copyright 2004 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data

contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. SAP NetWeaver “How-to” Guides are intended to simplify the product implementation. While specific product features and procedures typically are explained in a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using SAP NetWeaver. Should you wish to receive additional information, clarification or support, please refer to SAP Consulting. Any software coding and/or code lines / strings (“Code”) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent.

Page 3: How to Set Up a Web-Service-Related Scenario With SAP XI

1 Scenario........................................................................................................................2 2 Introduction..................................................................................................................2 3 The Step-By-Step Solution ..........................................................................................3

3.1 Create SLD Entries for SAP Web AS System.....................................................3 3.2 Design Inbound Message Interface in Integration Repository for Proxy Call to SAP Web AS System.......................................................................................................6 3.3 Proxy Generation in SAP Web AS System .........................................................8 3.4 Design Outbound Message Interface in Integration Repository..........................9 3.5 Design Inbound Message Interface in Integration Repository to Call .NET Application.....................................................................................................................10 3.6 Design Interface Mapping and Message Mappings in Integration Repository..11 3.7 Configure Adapters in Integration Directory.....................................................13 3.8 Configure Receiver Determination, Interface Determination, and Receiver Agreement in Integration Directory...............................................................................15

4 Appendix....................................................................................................................18 4.1 ABAP Proxy in SAP Web AS system ...............................................................18 4.2 WSDL File to Call .NET Application................................................................20

Page 4: How to Set Up a Web-Service-Related Scenario With SAP XI

1 Scenario A SAP Web Dynpro client sends a Web service request to SAP XI. The request performs a credit limit check and contains the amount as one of the input parameters. Based on a routing rule in SAP XI, the Web service request is directed to an SAP R/3 system (for small amounts) or to a .NET application (for larger amounts). The figure below shows an overview of the scenario:

2 Introduction The scenario is constructed using SAP XI 3.0. The screenshots are taken from DC8, where the SAP XI implementation took place. W17 is used as the SAP Web AS system. This guide does not explain the configuration of the SAP Web Dynpro client or the .NET application.

Page 5: How to Set Up a Web-Service-Related Scenario With SAP XI

3 The Step-By-Step Solution This chapter describes the following steps in detail:

• Create entries in System Landscape Directory (SLD) for SAP Web AS system • Design inbound message interface in Integration Repository for proxy call to SAP

Web AS system • Proxy generation in SAP Web AS system • Design outbound message interface in Integration Repository • Design inbound message interface in Integration Repository to call .NET

application • Design interface mapping and message mappings in Integration Repository • Configure adapters in Integration Directory • Configure receiver determination, interface determination, and receiver

agreement in Integration Directory

3.1 Create SLD Entries for SAP Web AS System

1. In W17, create RFC connection (TCP/IP) LCRSAPRFC by using transaction SM59. Application Server: sapwas17.wdf.sap.corp System Number: 00 User: demo01 Password: training Client: 100

2. In W17, create RFC connection (TCP/IP) SAPSLDAPI by using transaction SM59.

Page 6: How to Set Up a Web-Service-Related Scenario With SAP XI

3. In W17, create RFC connection (HTTP Connections to R/3 System) XI_INTEGRATION_SERVER_DC8 by using transaction SM59.

4. Entry for W17 in SLD technical landscape.

5. Under Installed Products, add software component version WebService XI Demo, 1.0 of xi.com.

Page 7: How to Set Up a Web-Service-Related Scenario With SAP XI

6. Entry for W17 in SLD business landscape.

Page 8: How to Set Up a Web-Service-Related Scenario With SAP XI

3.2 Design Inbound Message Interface in Integration Repository for Proxy Call to SAP Web AS System

7. Create data type CreditCheck. IDNumber: string IDCategory: string Currency: string Amount: string

8. Create message type CreditCheck. Data Type Used: CreditCheck

9. Create data type CreditCheckResponse. Status: string

Page 9: How to Set Up a Web-Service-Related Scenario With SAP XI

10. Create message type CreditCheckResponse. Data Type Used: CreditCheckResponse

11. Create message interface CreditCheck_In. Namespace: http://sap.com/xi/WebService/demo Software Component Version: WebService XI Demo, 1.0 of xi.com Category: Inbound Mode: Synchronous Input Message: CreditCheck Output Message: CreditCheckResponse

Page 10: How to Set Up a Web-Service-Related Scenario With SAP XI

3.3 Proxy Generation in SAP Web AS System

12. Activate Integration Engine (SAP XI message format) in W17 by using transaction SICF.

13. Create ABAP proxy in W17 by using transaction SPROXY. Software Component Version: WebService XI Demo, 1.0 of xi.com Namespace: http://sap.com/xi/WebService/demo Message Interface: CreditCheck_In Coding of ABAP proxy: See appendix (ABAP Proxy in SAP Web AS System)

Page 11: How to Set Up a Web-Service-Related Scenario With SAP XI

3.4 Design Outbound Message Interface in Integration Repository

14. Create message interface CreditCheck_Out in Integration Repository. Namespace: http://sap.com/xi/WebService/demo Software Component Version: WebService XI Demo, 1.0 of xi.com Category: Outbound Mode: Synchronous Input Message: CreditCheckResponse Output Message: CreditCheck

Page 12: How to Set Up a Web-Service-Related Scenario With SAP XI

3.5 Design Inbound Message Interface in Integration Repository to Call .NET Application

15. Create external definition CreditLimitCheck. Category: wsdl Messages: From All Available Message Definitions File: CreditLimitCheck.wsdl Messages: TLS_CreditLimitCheck_DunsSoapIn, TLS_CreditLimitCheck_DunsSoapOut Imported Document: See appendix (WSDL File to Call .NET Application)

16. Create message interface TLS_CreditLimitCheck_DunsSoap_In. Namespace: http://sap.com/xi/WebService/demo Software Component Version: WebService XI Demo, 1.0 of xi.com Category: Inbound Mode: Synchronous Input Message: TLS_CreditLimitCheck_DunsSoapIn Output Message: TLS_CreditLimitCheck_DunsSoapOut Context Objects: dunsNumber: string currency: string amount: int

Page 13: How to Set Up a Web-Service-Related Scenario With SAP XI

3.6 Design Interface Mapping and Message Mappings in Integration Repository

17. Create message mapping CreditCheckToTLS_Req. Namespace: http://sap.com/xi/WebService/demo Software Component Version: WebService XI Demo, 1.0 of xi.com IDNumber -> ns0:dunsNumber Currency -> ns0:currency Amount -> ns0:amount

18. Create message mapping CreditCheckToTLS_Res. Namespace: http://sap.com/xi/WebService/demo Software Component Version: WebService XI Demo, 1.0 of xi.com TLS_CreditLimitCheck_DunsResult -> Status

19. Create interface mapping CreditCheckToTLS. Namespace: http://sap.com/xi/WebService/demo Software Component Version: WebService XI Demo, 1.0 of xi.com Source Interface: CreditCheck_OutTarget Interface: TLS_CreditLimitCheck_DunsSoap_In Request Message Mapping: CreditCheckToTLS_Req Request Source Message: CreditCheck Request Target Message: TLS_CreditLimitCheck_DunsSo

Page 14: How to Set Up a Web-Service-Related Scenario With SAP XI

apIn Response Message Mapping: CreditCheckToTLS_Res Response Source Message: CreditCheckResponse Response Target Message: TLS_CreditLimitCheck_DunsSoapOut

Page 15: How to Set Up a Web-Service-Related Scenario With SAP XI

3.7 Configure Adapters in Integration Directory

20. Configure Sender SOAP Adapter. Scenario: WebServiceDemo, Service without Party Business Service: WebServiceClient Communication Channel: SOAP_Client Transport Protocol: HTTP Message Protocol: SOAP 1.1 Adapter Engine: Integration Server Keep Headers: false Keep Attachments: false Use Encoded Headers: false Use Query String: false Interface Namespace: http://sap.com/xi/WebService/demo Interface Name: CreditCheck_Out Quality of Service: Best Effort

21. Configure Receiver SOAP Adapter. Scenario: WebServiceDemo, Service without Party Business Service: Soap_Receiver_Banking Communication Channel: SOAP Transport Protocol: HTTP Message Protocol: SOAP 1.1 Adapter Engine: Integration Server Target URL: http://10.18.102.0:1085/IDESBankingBackend/CreditLimitCheck.asmx Keep Headers: false Keep Attachments: false Use Encoded Headers: false Use Query String: false

Page 16: How to Set Up a Web-Service-Related Scenario With SAP XI

22. Configure module in receiver SOAP adapter. Module Key: Soap Parameter Name: XMBWS.Default.SOAPAction Parameter Value: http://tempuri.org/IDESBankingBackend/CreditLimitCheck/TLS_CreditLimitCheck_Duns

23. Configure Receiver XI Adapter. Scenario: WebServiceDemo, Service without Party Business System: W17_100 Communication Channel: GeneratedReceiverChannel_XITransport Protocol: HTTP 1.0 Message Protocol: XI 3.0 Adapter Engine: Integration Server Addressing Type: HTTP Destination HTTP Destination: W17_100

Page 17: How to Set Up a Web-Service-Related Scenario With SAP XI

3.8 Configure Receiver Determination, Interface Determination, and Receiver Agreement in Integration Directory

24. Configure receiver determination. Service: WebServiceClient Interface: CreditCheck_Out Namespace: http://sap.com/xi/WebService/demo Condition 1: (/p1:CreditCheck/Amount[number(text()) <= 100000] EX ) -> Service: Soap_Receiver_Banking -> Then, configure the interface determination and receiver agreement. Once you have configured each of the objects, the configuration view displays the following: Interface: TLS_CreditLimitCheck_DunsSoap_In -> Mapping Program: CreditCheckToTLS -> Receiver Agreement: Soap Condition 2: (/p1:CreditCheck/Amount[number(text()) > 100000] EX ) -> Service: W17_100 -> Then, configure the interface determination and receiver agreement. Once you have configured each of the objects, the configuration view displays the following: Interface: CreditCheck_In -> Mapping Program Not Specified -> Receiver Agreement: GeneratedReceiverChannel_XI

Page 18: How to Set Up a Web-Service-Related Scenario With SAP XI

25. Configure interface determination. Service: WebServiceClient Interface: CreditCheck_Out Namespace: http://sap.com/xi/WebService/demo Service: Soap_Receiver_BankingInterface: TLS_CreditLimitCheck_DunsSoap_In Mapping Program: CreditCheckToTLS

26. Configure interface determination. Service: WebServiceClient Interface: CreditCheck_Out Namespace: http://sap.com/xi/WebService/demo Service: W17_100 Interface: CreditCheck_In Mapping Program Not Specified

27. Configure receiver agreement. Service: WebServiceClient Interface: CreditCheck_Out Namespace: http://sap.com/xi/WebService/demo Service: Soap_Receiver_BankingInterface: TLS_CreditLimitCheck_DunsSoap_In Receiver Communication Channel: Soap

Page 19: How to Set Up a Web-Service-Related Scenario With SAP XI

28. Configure receiver agreement. Service: WebServiceClient Interface: CreditCheck_Out Namespace: http://sap.com/xi/WebService/demo Service: W17_100 Interface: CreditCheck_In Receiver Communication Channel: GeneratedReceiverChannel_XI

Page 20: How to Set Up a Web-Service-Related Scenario With SAP XI

4 Appendix

4.1 ABAP Proxy in SAP Web AS system method ZII_CREDIT_CHECK_IN~EXECUTE_SYNCHRONOUS. DATA: CreditTableRow TYPE ZCREDIT_INFO, CreditTable TYPE STANDARD TABLE OF ZCREDIT_INFO, AMOUNT TYPE N, LIMT TYPE N. *Initialising Data CreditTableRow-STATUS = '1001'. CreditTableRow-SCORE = '999'. CreditTableRow-CREDIT_LIMIT = '500000'. CreditTableRow-LIMIT_CURRENCY = 'USD'. CreditTableRow-VALID_TO = '01-01-2005'. INSERT CreditTableRow INTO CreditTable INDEX 1. CreditTableRow-STATUS = '1002'. CreditTableRow-SCORE = '615'. CreditTableRow-CREDIT_LIMIT = '150000'. CreditTableRow-LIMIT_CURRENCY = 'USD'. CreditTableRow-VALID_TO = '07-01-2004'. INSERT CreditTableRow INTO CreditTable INDEX 2. CreditTableRow-STATUS = '1003'. CreditTableRow-SCORE = '890'. CreditTableRow-CREDIT_LIMIT = '450000'. CreditTableRow-LIMIT_CURRENCY = 'USD'. CreditTableRow-VALID_TO = '04-01-2005'. INSERT CreditTableRow INTO CreditTable INDEX 3. CreditTableRow-STATUS = '1004'. CreditTableRow-SCORE = '985'. CreditTableRow-CREDIT_LIMIT = '600000'. CreditTableRow-LIMIT_CURRENCY = 'USD'. CreditTableRow-VALID_TO = '03-01-2005'. INSERT CreditTableRow INTO CreditTable INDEX 4. CreditTableRow-STATUS = '1005'. CreditTableRow-SCORE = '45'. CreditTableRow-CREDIT_LIMIT = '1000'. CreditTableRow-LIMIT_CURRENCY = 'USD'. CreditTableRow-VALID_TO = '01-01-2004'. INSERT CreditTableRow INTO CreditTable INDEX 5. * Start of CreditLimitCheck

Page 21: How to Set Up a Web-Service-Related Scenario With SAP XI

OUTPUT-CREDIT_CHECK_RESPONSE-STATUS = 'No Category found'. CASE INPUT-CREDIT_CHECK-IDCATEGORY. WHEN 'FSC0001'. IF INPUT-CREDIT_CHECK-IDNUMBER EQ '12345678'. IF INPUT-CREDIT_CHECK-AMOUNT LE '10000'. OUTPUT-CREDIT_CHECK_RESPONSE-STATUS = 'OK'. ELSE. OUTPUT-CREDIT_CHECK_RESPONSE-STATUS = 'Credit Limit Exceeded'. ENDIF. ELSE. OUTPUT-CREDIT_CHECK_RESPONSE-STATUS = 'No Business Partner found'. ENDIF. WHEN 'BUP0001'. OUTPUT-CREDIT_CHECK_RESPONSE-STATUS = 'No Business Partner found'. LOOP AT CreditTable INTO CreditTableRow. IF CreditTableRow-STATUS EQ INPUT-CREDIT_CHECK-IDNUMBER. IF INPUT-CREDIT_CHECK-AMOUNT LE CreditTableRow-CREDIT_LIMIT. OUTPUT-CREDIT_CHECK_RESPONSE-STATUS = 'OK'. ELSE. OUTPUT-CREDIT_CHECK_RESPONSE-STATUS = 'Credit Limit Exceeded'. ENDIF. EXIT. ENDIF. ENDLOOP. when others. OUTPUT-CREDIT_CHECK_RESPONSE-Status = 'Unknown id category found'. ENDCASE. endmethod.

Page 22: How to Set Up a Web-Service-Related Scenario With SAP XI

4.2 WSDL File to Call .NET Application <?xml version="1.0" encoding="ISO-8859-1"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s0="http://tempuri.org/IDESBankingBackend/CreditLimitCheck" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://tempuri.org/IDESBankingBackend/CreditLimitCheck"> <types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/IDESBankingBackend/CreditLimitCheck"> <s:element name="TLS_CreditLimitCheck_Duns"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="dunsNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="currency" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="amount" type="s:int" /> </s:sequence> </s:complexType> </s:element> <s:element name="TLS_CreditLimitCheck_DunsResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="TLS_CreditLimitCheck_DunsResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> </s:schema> </types> <message name="TLS_CreditLimitCheck_DunsSoapIn"> <part name="parameters" element="s0:TLS_CreditLimitCheck_Duns" /> </message> <message name="TLS_CreditLimitCheck_DunsSoapOut"> <part name="parameters" element="s0:TLS_CreditLimitCheck_DunsResponse" /> </message> <portType name="CreditLimitCheckSoap"> <operation name="TLS_CreditLimitCheck_Duns"> <input message="s0:TLS_CreditLimitCheck_DunsSoapIn" /> <output message="s0:TLS_CreditLimitCheck_DunsSoapOut" />

Page 23: How to Set Up a Web-Service-Related Scenario With SAP XI

</operation> </portType> <binding name="CreditLimitCheckSoap" type="s0:CreditLimitCheckSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="TLS_CreditLimitCheck_Duns"> <soap:operation soapAction="http://tempuri.org/IDESBankingBackend/CreditLimitCheck/TLS_CreditLimitCheck_Duns" style="document" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation> </binding> <service name="CreditLimitCheck"> <port name="CreditLimitCheckSoap" binding="s0:CreditLimitCheckSoap"> <soap:address location="http://p65042/IDESBankingBackend/CreditLimitCheck.asmx" /> </port> </service> </definitions>

Page 24: How to Set Up a Web-Service-Related Scenario With SAP XI

www.sap.com/netweaver