;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU...

22
6$3 $*Ø 1HXURWWVWUØ ’:DOOGRUI ;0/&RPPXQLFDWLRQ 6$3%XVLQHVV&RQQHFWRU &RQILJXUDWLRQ*XLGH +RZWRHQDEOHWKHVWDQGDUG6$3 FRPPXQLFDWLRQWHFKQLTXHVIRUWKHLQWHUQHW 6$3%XVLQHVV&RQQHFWRU 5HOHDVH

Transcript of ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU...

Page 1: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

6$3�

�$*����é 1HXURWWVWU��������é '�������:DOOGRUI�

;0/�&RPPXQLFDWLRQ���6$3�%XVLQHVV�&RQQHFWRU�

&RQILJXUDWLRQ�*XLGH��

+RZ�WR�HQDEOH�WKH�VWDQGDUG�6$3�

FRPPXQLFDWLRQ�WHFKQLTXHV�IRU�WKH�LQWHUQHW�

� �6 $3 � % X V L Q H V V � & R Q Q H F W R U � �

5 H O H D V H � � � � �

Page 2: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� LL�

&RS\ULJKW� Copyright 2000 SAP AG. All rights reserved. No part of this documentation may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. SAP AG further does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP AG shall not be liable for any special, indirect, incidental, or consequential damages, including without limitation, lost revenues or lost profits, which may result from the use of these materials. The information in this documentation is subject to change without notice and does not represent a commitment on the part of SAP AG in the future. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft®, WINDOWSÒ , NT®, EXCELÒ and SQL-Server® are registered trademarks of Microsoft Corporation. IBM®, OS/2Ò , DB2/6000®, AIX®, OS/400®, AS/400® are a registered trademark of IBM Corporation. OSF/MotifÒ is a registered trademark of Open Software Foundation. ORACLEÒ is a registered trademark of ORACLE Corporation, California, USA. INFORMIXÒ -OnLine for SAP is a registered trademark of Informix Software Incorporated. UNIX® and X/Open® are registered trademarks of SCO Santa Cruz Operation. ADABASÒ is a registered trademark of Software AG SAPÒ , R/2®, R/3®, RIVA®, ABAP/4Ò , SAPofficeÒ , SAPmailÒ , SAPaccess®, SAP-EDIÒ , SAP ArchiveLinkÒ , SAP EarlyWatch®, SAP Business WorkflowÒ , R/3 Retail® are registered trademarks of SAP AG All rights reserved.

Page 3: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� LLL�

&RQWHQWV�

�� ,1752'8&7,21 ���������������������������������������������������������������������������������������������������������������������������������������� ��

�� 1(&(66$5<�&86720,=,1*�,1�7+(�%86,1(66�&211(&725���������������������������������������������������� ��

2.1 ADDING NEW USERS ...................................................................................................................................... 6 2.2 SECURING THE SERVICES ............................................................................................................................... 6 2.3 ADDING SAP SYSTEMS.................................................................................................................................. 7 2.4 ADDING ROUTING RULES .............................................................................................................................. 8 2.5 ACCESSING BUSINESS CONNECTOR FUNCTIONALITY..................................................................................... 8

�� ,'2&�&20081,&$7,21������������������������������������������������������������������������������������������������������������������������ ��

3.1 IDOC OUTBOUND PROCESSING (SAP IS CLIENT) ............................................................................................ 9 3.2 IDOC INBOUND PROCESSING (SAP IS SERVER)............................................................................................. 11

�� %$3,�&20081,&$7,21����������������������������������������������������������������������������������������������������������������������� ���

4.1 BAPI OUTBOUND PROCESSING (SAP IS CLIENT) ......................................................................................... 13 4.2 BAPI INBOUND PROCESSING (SAP IS SERVER)............................................................................................ 15

�� 5)&�&20081,&$7,21 ������������������������������������������������������������������������������������������������������������������������ ���

5.1 RFC OUTBOUND PROCESSING (SAP IS CLIENT)........................................................................................... 17 5.2 RFC INBOUND PROCESSING (SAP IS SERVER) ............................................................................................. 19

�� &21),*85,1*�7+(�%86,1(66�&211(&725�)25�66/��+7736� ���������������������������������������������� ���

6.1 INSTALLING THE CERTIFICATES INTO THE BUSINESS CONNECTOR ............................................................... 21 6.2 CREATING AN HTTPS LISTENER IN THE BUSINESS CONNECTOR ................................................................. 21 6.3 IMPORTING THE CLIENT CERTIFICATE INTO THE BUSINESS CONNECTOR ...................................................... 21 6.4 INSTALLING CERTIFICATES INTO YOUR WEB BROWSER............................................................................... 22

�� $'',7,21$/�+,176������������������������������������������������������������������������������������������������������������������������������� ���

Page 4: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ��

�� ,QWURGXFWLRQ�

3XUSRVH�RI�WKLV�GRFXPHQW�

This document describes how the standard SAP communication techniques (i.e. Idocs, BAPIs and RFCs) can be easily enabled for the internet using XML and the SAP Business Connector version 3.5. It’s described, how the partners can customize their test-copy of the SAP Business Connector 3.5. To get this tool you must be SAP customer or have a valid Developer Package or have a valid Test- and Demo-License. Additionally we provide access to a Business Connector 3.5 over the Internet. This is not a complete documentation about the Business Connector or Internet technologies. To find out more about these topics, please consider the related documents.

5HOHDVH�1RWHV�

The new Business Connector Release 3.5 behaves slightly different compared with the Business Connector 3.1: ���FUHDWH7,'�The html response of the createTID service is slightly different. Please make sure that you can get a correct TID from Business Connector 3.5 and Business Connector 3.1. ���RXWERXQG�,GRF�

When receiving an Idoc from the Business Connector 3.1, it was enough to send an empty body as response to confirm the Idoc. With the Business Connector 3.5 the body must not be empty. You can fix the problem in two ways: a) Change your program and send back an empty idoc as confirmation:

Content-Type: application/x-sap.idoc <IDOC/>

b) Apply a patch that will fix the problem (recommended!). This patch will be shipped to customers.

���LQERXQG�5)&�When an RFC call leeds to an RFC exception, the Business Connector 3.5 sends back the correct bXML document containing the exception, but sets the HTTP status to 403 (the old one used 200). Please make sure, that your program can receive the bXML document even though the status indicates an error.

5HODWHG�'RFXPHQWV�

• SAP Business Connector Documentation (e.g. http://service.sap.com/connectors -> Business Connector -> Documentation)

• SAP Internet Adviser (for customers/partners: http://service.sap.com/internetadviser) • SAP RFC software development kit helpfiles

(e.g. \gui\windows\win32\sapgui\rfcsdk\help on the presentation CD) • SAP Interface Repository (http://ifr.sap.com) to learn more about SAP’s XML

Schemas • Internet Request for Comments (e.g. no. 2616 and no. 2617) (http://www.cis.ohio-

state.edu/hypertext/information/rfc.html ) • A lot of information about XML and HTTPS (SSL) can be found in the internet

Page 5: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ��

&HUWLILFDWLRQ�5HTXLUHPHQWV�

A software product must at least meet the following requirements in order to become certified as an XML enabled product. More details about the requirements can be found in the testplan belonging to the integration scenario. • Internet communication using the protocols HTTP and HTTPS with the SAP

Business Connector • Adding necessary customizing into the SAP Business Connector • Sending and receiving the communication objects (i.e. Idocs, BAPIs or RFCs) that

are needed in the chosen integration scenario in XML format.

3UHSDUDWLRQV�

The certification takes place in one of the SAP certification centers around the world. The partner will bring it’s own computer(s) with the software products to be certified. The software product may be already preinstalled; the installation of the partner’s software is not part of the certification. Partner’s machine will be connected to an Ethernet LAN so it can access the SAP systems used for certification. For the communication with the SAP systems an internal Business Connector is used that is configured in the same way as described in this document.

Page 6: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ��

�� 1HFHVVDU\�FXVWRPL]LQJ�LQ�WKH�%XVLQHVV�&RQQHFWRU�

Start the Business Connector by calling <root>/sapbc/server/bin/server.bat. If you want to have a debug output, enter server.bat –debug <debuglevel> –log <filename>. The highest debuglevel is 10. With -log none the debug output is written into the command window. To enter the administration screen of the Business Connector, simply enter the address of the Business Connector into a web browser (e.g. http://localhost:5555 ) . Your default account is user “Administrator” and password “manage”. 1RWH� The HTTP protocol is mentioned throughout this document to communicate with the SAP Business Connector but it is also applied to the HTTPS protocol.

����$GGLQJ�QHZ�XVHUV� If you want to send data from an R/3 system to the BC, you need the same user in both systems. To create a user in the BC, first press “Access” and study the Password Security Settings. Then press “Add” and enter the user name (all uppercase!!) and a password that matches with the Password Security Settings (e.g. if your user in the R/3 system is “smith” then you must add a user “SMITH”). Mark all the groups using the CTRL-key and press the “Submit” button. You can test your new user by pressing “Logout” and then “Resume”.

����6HFXULQJ�WKH�VHUYLFHV� In the standard configuration, all the BC services can be called via HTTP without providing any user information. In the certification test we will use secured services and you have to send user/password BASE64 encoded to access them. We need to secure 5 services: &UHDWH7,'��

Press “Services” on the left and then “SAP” in the main part of the screen. Click the lock-icon in the “CreateTID”-row. Then choose “Access Control” = “Administrators” and press the “Submit” button. Now you should see the word “Administrators” in the “CreateTID”-row instead of the lock-icon.

&RQILUP7,' Press “Services” on the left and then “SAP” in the main part of the screen. Click the lock-icon in the “ConfirmTID”-row and choose “Access Control” = “Administrators”.

$/(�,QERXQG3URFHVV�

Press “Services” on the left and then “wm” -> ”wm.PartnerMgr” -> “wm.PartnerMgr.gateway” -> “wm.PartnerMgr.gateway.transport” -> “wm.PartnerMgr.gateway.transport.ALE” in the main part of the screen. Click the lock-icon in the “InboundProcess”-row and choose “Access Control” = “Administrators”.

%$3,�,QERXQG3URFHVV�

Press “Services” on the left and then “wm” -> ”wm.PartnerMgr” -> “wm.PartnerMgr.gateway” -> “wm.PartnerMgr.gateway.transport” -> “wm.PartnerMgr.gateway.transport.BAPI” in the main part of the screen. Click the lock-icon in the “InboundProcess”-row and choose “Access Control” = “Administrators”.

Page 7: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ��

5)&�,QERXQG3URFHVV�

Press “Services” on the left and then “wm” -> ”wm.PartnerMgr” -> “wm.PartnerMgr.gateway” -> “wm.PartnerMgr.gateway.transport” -> “wm.PartnerMgr.gateway.transport.RFC” in the main part of the screen. Click the lock-icon in the “InboundProcess”-row and choose “Access Control” = “Administrators”.

����$GGLQJ�6$3�V\VWHPV� You need to specify every SAP system that should be used within the Business Connector. Press the “SAP” button, then “Add server”, and then enter a name for the destination and the necessary logon information. In the following screenshot an SAP system with name 6$36<67(0� is added:

Now communication between the Business Connector and the SAP system 6$36<67(0, where SAP is the server, is possible.

Page 8: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ��

If you want to use the other direction as well (SAP is client), you need to install one or more listeners for this SAP system. To do this, press the “SAP” button and click on the “Listener”-field for the SAP system. Then you can add a listener (e.g. 0</,67(1(5):

After pressing save, press the red ball-icon in the “Started” column so that it turns green. Now add in the SAP system with SM59 an RFC-destination that refers to the created ProgramID 0</,67(1(5. Then you can call the Business Connector from the SAP system using this RFC-destination. Attention: Your R/3 user must exist in the BC. See “2.1 Adding new users”

����$GGLQJ�5RXWLQJ�5XOHV� Whenever a call arrives in the Business Connector, either from SAP with the RFC protocol or from the external system with the HTTP(S) protocol, it has to determine the recipient of the call. To do this, the Business Connector looks into the call and extracts information about the 6HQGHU, 5HFHLYHU and 0VJ7\SH� Every call has to contain this kind of routing information. Then it looks into its list of Routing Rules and tries to find a rule that matches the routing information. In the rule the Business Connector can find the recipient and the format that should be used to send the call to this recipient. You can add Routing Rules by pressing the button “Routing”. There you need to specify the Sender, Receiver and the MsgType and click the “Add Rule” button. After that you need to specify the “Transport” and enter the “Transport Parameters”. Which value to choose for the different SAP communication objects and directions is explained in the next chapters.

����$FFHVVLQJ�%XVLQHVV�&RQQHFWRU�IXQFWLRQDOLW\� To access functionality in the Business Connector, so called VHUYLFHV are called via HTTP. This is done by posting a document containing the parameters to the service. In our case, we always post documents containing the XML format of the Idoc or BAPI/RFC-call to a service of the Business Connector that converts the document and calls the SAP system.

Page 9: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ��

The following statements must be used to post a document to the /sap/InboundIdoc service of the Business Connector. The keyword invoke must not be omitted. The empty line that follows the header is also very important!

POST /invoke/sap/InboundIdoc HTTP/1.0 <?xml version="1.0" encoding="iso-8859-1"?> <ALEREQ01> <IDOC BEGIN="1"> ...

Which services of the Business Connector should be used for the different SAP communication objects are explained in the next chapters.

�� ,GRF�FRPPXQLFDWLRQ��

����,GRF�2XWERXQG�SURFHVVLQJ��6$3�LV�FOLHQW�� In the ALE customizing (transaction SALE) you specify the sender and the receiver for an Idoc (e.g. sender SAP and receiver EXTERNAL, Idoc message type MATMAS). Then you can send this Idoc to the Business Connector using an appropriate RFC destination.

&UHDWLQJ�WKH�5RXWLQJ�5XOH�

You need to add the following Routing Rule, to convert the Idoc into XML and send it from the Business Connector with HTTP to an external webserver:

Page 10: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

5HFHLYLQJ�WKH�,GRF�

Your external webserver will receive an HTTP request containing a header with HTTP parameters and an XML document containing the Idoc in XML format. You can see that the routing information in the control record of the Idoc matches with the Routing Rule in the Business Connector. Content-type: application/x-sap.idoc Content-length: [length of XML doc]�������������+773�+HDGHU X-tid: [TID] �

<?xml version="1.0" encoding="iso-8859-1"?> <MATMAS02> <IDOC BEGIN="1"> <EDI_DC40 SEGMENT="1"> <RCVPRN>(;7(51$/</RCVPRN> <SNDPRN>6$3</SNDPRN> <MESTYP>0$70$6</MESTYP> ...����������������������������������������;0/�'RFXPHQW </EDI_DC40> <E1MARAM SEGMENT="1"> ... </E1MARAM> </IDOC> </MATMAS01> You need to answer the HTTP request that was initiated by the Business Connector. �

$77(17,21� With the BC 3.5, you need to answer the request with an empty Idoc or you must apply a patch (is included in the partner documentation package)!! Content-type: application/x-sap.idoc �

<IDOC/>

7,'�KDQGOLQJ�

You can extract the TID from the HTTP header (parameter X-tid). If an error during transmission occurred, SAP will resend the Idoc using the same TID. So you need to store the TIDs in a database and check every TID that you receive from SAP: 1) 7,'�UHFHLYHG�IRU�WKH�ILUVW�WLPH: This transmission was never done before. The Idoc

must be stored and processed. The TID must also be stored into a database. 2) 7,'�DOUHDG\�UHFHLYHG: This Idoc was transferred before, but an error occurred. So DO

NOT store or process this Idoc again. The Business Connector does not confirm successful transactions. So your product must delete old TIDs after a significant time.

Page 11: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

����,GRF�,QERXQG�SURFHVVLQJ��6$3�LV�VHUYHU��

&UHDWLQJ�WKH�5RXWLQJ�5XOH�

Before you can send Idocs to SAP, you need to create a Routing Rule in the Business Connector that matches the routing information in the Idoc control record:

*HWWLQJ�D�7,'�

The Business Connector can ask a SAP system to create a worldwide unique TID. We will use this service in the certification test. In the production environment such an additional HTTP request might cost too much time. If it is the case, you can calculate and use your own ‘pseudo TID’. To get a TID from the Business Connector, use the /sap/createTID service and specify the SAP system, which should calculate the TID (e.g. 6$36<67(0). POST /invoke/sap/createTID HTTP/1.0 Content-length: [length of doc] Authorization: Basic [user/passwd BASE64 encoded] serverName=6$36<67(0

Page 12: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

The Business Connector answers this HTTP request with an HTML document containing the TID.

6HQGLQJ�WKH�,GRF�

Now you can post the Idoc in XML format to the Business Connector service /wm. PartnerMgr.gateway.transport.ALE/InboundProcess. Use the HTTP parameter X-tid to send the TID to the SAP system. Again, the routing information in the Idoc control record has to match with a Routing Rule in the Business Connector.

POST /invoke/wm.PartnerMgr.gateway.transport.ALE/InboundProcess Content-type: application/x-sap.idoc Content-length: [length of doc] +773�+HDGHU Authorization: Basic [user/passwd BASE64 encoded] X-tid: [TID to use] �

<?xml version="1.0" encoding="iso-8859-1"?> <MATMAS02> <IDOC BEGIN="1"> <EDI_DC40 SEGMENT="1"> <RCVPRN>6$3</RCVPRN> <SNDPRN>(;7(51$/</SNDPRN> <MESTYP>0$70$6</MESTYP> ...����������������������������������������������;0/�'RFXPHQW </EDI_DC40> <E1MARAM SEGMENT="1"> ... </E1MARAM> </IDOC> </MATMAS01>

3URFHVVLQJ�WKH�DQVZHU�RI�WKH�%XVLQHVV�&RQQHFWRU�

If the call succeeds, the Business Connector answers with an OK-status. Then you can confirm the TID. If the call fails (e.g. timeout), you must resend the Idoc with the same TID, so that the SAP system can detect a retransmission.

&RQILUPLQJ�WKH�7,'�

You should confirm the TID to delete it from the SAP tables. You must use the same SAP system for the confirmation that was used to create the TID: POST /invoke/sap/confirmTID HTTP/1.0 Content-length: [length of doc] Authorization: Basic [user/passwd BASE64 encoded] serverName=6$36<67(0&$tid=[TID to use]

Page 13: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

�� %$3,�FRPPXQLFDWLRQ��

����%$3,�2XWERXQG�SURFHVVLQJ��6$3�LV�FOLHQW�� BAPI calls are sent to the Business Connector using an appropriate RFC destination.

&UHDWLQJ�WKH�5RXWLQJ�5XOH�

The routing information of a BAPI call consists of the SAP systemID (e.g. 6$36<67(0), the used RFC destination (e.g. (;7B'(67) and the name of the function module representing the BAPI (e.g. %$3,B&86720(5B6($5&+). The Routing Rule in the Business Connector must match this information. In the Routing Rule, the Business Object and the Method of the BAPI must be specified:

5HFHLYLQJ�WKH�%$3,�FDOO�

Your external webserver will receive an HTTP request containing a header with HTTP parameters and an XML document containing the BAPI call in XML format. You can see that the routing information contained in the XML document matches with the Routing Rule in the Business Connector �

1RWH� In the XML document the Message Type of the Routing Rule (e.g. BAPI_CUSTOMER_ SEARCH) is replaced by the BAPI name (Customer.Search).

Page 14: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

Content-type: application/x-sap.busdoc Content-length: [length of doc] +773�+HDGHU �

<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery> <to> <address>urn:sap-com:logical-system:(;7B'(67</address> </to> <from> <address>urn:sap-com:logical-system:6$36<67(0</address> </from> </delivery> </header> <body xmlns=""> <doc:&XVWRPHU�6HDUFK xmlns:doc="urn:sap-com:document:..."> <PiSalesorg>0001</PiSalesorg> <PiSearchFlag>2</PiSearchFlag> </doc:Customer.Search> </body> </biztalk_1>

Now you can parse and process the BAPI call and then return the result.

6HQGLQJ�WKH�%$3,�UHVSRQVH�

You answer the HTTP request initiated by the Business Connector with the result of the BAPI call in XML format:

Content-type: application/x-sap.busdoc �

<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery/> </header> <body xmlns=""> <doc:Customer.Search.Response xmlns:doc="urn:sap-com:..."> <PiSalesorg>0001</PiSalesorg> <PiSearchFlag>2</PiSearchFlag> <Multiple> <item> <CUSTOMER>10001</CUSTOMER> </item> <item> <CUSTOMER>10002</CUSTOMER> </item> <PeCustomer/> <Return/> </doc:Customer.Search.Response> </body> </biztalk_1>

Page 15: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

����%$3,�,QERXQG�SURFHVVLQJ��6$3�LV�VHUYHU��

&UHDWLQJ�WKH�5RXWLQJ�5XOH�

Before you can call BAPIs in the SAP system, you need to create a Routing Rule in the Business Connector that matches the routing information in the BAPI XML document. �

1RWH� The Message Type must match now with the BAPI and not with the function module.

6HQGLQJ�WKH�%$3,�FDOO�

Now you can post the BAPI call in XML format to the Business Connector service /wm. PartnerMgr.gateway.transport.BAPI/InboundProcess. Again, the routing information in the XML document has to match with the Routing Rule created in the Business Connector.

Page 16: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

POST /invoke/wm.PartnerMgr.gateway.transport.BAPI/InboundProcess Content-type: application/x-sap.busdoc �Content-length: [length of doc] +773�+HDGHU Authorization: Basic [user/passwd BASE64 encoded] �������������������������������������������������������<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery> <to> <address>urn:sap-com:logical-system:6$3</address> </to> <from> <address>urn:sap-com:logical-system:(;7(51$/</address> </from> </delivery> </header> <body xmlns=""> <doc:&XVWRPHU�6HDUFK xmlns:doc="urn:sap-com:document:..."> <PiSalesorg>0001</PiSalesorg> <PiSearchFlag>2</PiSearchFlag> </doc:Customer.Search> </body> </biztalk_1>

5HFHLYLQJ�WKH�%$3,�UHVSRQVH�RI�WKH�%XVLQHVV�&RQQHFWRU�

If the call succeeds, the Business Connector answers with the result of the BAPI call:

<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery/> </header> <body xmlns=""> <doc:Customer.Search.Response xmlns:doc="urn:sap-com:..."> <Multiple> <item> <CUSTOMER>D2443</CUSTOMER> </item> <item> <CUSTOMER>D2444</CUSTOMER> </item> </Multiple> <PeCustomer/> <Return/> </doc:Customer.Search.Response> </body> </biztalk_1>

Page 17: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

�� 5)&�FRPPXQLFDWLRQ��

����5)&�2XWERXQG�SURFHVVLQJ��6$3�LV�FOLHQW�� RFC calls are sent to the Business Connector using an appropriate RFC destination.

&UHDWLQJ�WKH�5RXWLQJ�5XOH�

The routing information of a RFC call consists of the SAP systemID (e.g. 6$36<67(0), the used RFC destination (e.g. (;7B'(67) and the name of the RFC function module (e.g. 4,5)B6(1'B&$7$/2*B'$7$). The Routing Rule in the Business Connector must match this information:

5HFHLYLQJ�WKH�5)&�FDOO�

Your external webserver will receive an HTTP request containing a header with HTTP parameters and an XML document containing the RFC call in XML format. You can see that the routing information contained in the XML document matches with the Routing Rule in the Business Connector.

Page 18: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

Content-type: application/x-sap.busdoc Content-length: [length of doc] +773�+HDGHU �

<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery> <to> <address>urn:sap-com:logical-system:(;7B'(67</address> </to> <from> <address>urn:sap-com:logical-system:6$36<67(0</address> </from> </delivery> </header> <body> <doc:4,5)B6(1'B&$7$/2*B'$7$ xmlns:doc="urn:sa..." xmlns=""> <I_CATALOG>COLOR</I_CATALOG> <T_QAICATAB/> <T_QIERRTAB/> </doc:QIRF_SEND_CATALOG_DATA> </body> </biztalk_1>

Now you can parse and process the RFC call and then return the result.

6HQGLQJ�WKH�5)&�UHVSRQVH�

You answer the HTTP request initiated by the Business Connector with the result of the RFC call in XML format:

Content-type: application/x-sap.busdoc �

<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery/> </header> <body> <doc:QIRF_SEND_CATALOG_DATA.Response xmlns:doc="ur..." xmlns=""> <T_QAICATAB> <item> <SATZART>Q45</SATZART> <KATALGART>1</KATALGART> <CODEGRUPPE>COLOR</CODEGRUPPE> <CODE>1</CODE> <KURZTEXT>Red</KURZTEXT> <QKENNZAHL>000</QKENNZAHL> </item> </T_QAICATAB> <T_QIERRTAB/> </doc:QIRF_SEND_CATALOG_DATA.Response> </body> </biztalk_1>

Page 19: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

����5)&�,QERXQG�SURFHVVLQJ��6$3�LV�VHUYHU��

&UHDWLQJ�WKH�5RXWLQJ�5XOH�

Before you can call RFCs in the SAP system, you need to create a Routing Rule in the Business Connector that matches the routing information in the RFC XML document.

6HQGLQJ�WKH�5)&�FDOO�

Now you can post the RFC call in XML format to the Business Connector service /wm. PartnerMgr.gateway.transport.RFC/InboundProcess. Again, the routing information in the XML document has to match with the Routing Rule created in the Business Connector.

Page 20: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

POST /invoke/wm.PartnerMgr.gateway.transport.RFC/InboundProcess Content-type: application/x-sap.busdoc �Content-length: [length of doc] +773�+HDGHU Authorization: Basic [user/passwd BASE64 encoded] �<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery> <to> <address>urn:sap-com:logical-system:6$3</address> </to> <from> <address>urn:sap-com:logical-system:(;7(51$/</address> </from> </delivery> </header> <body> <doc:4,5)B6(1'B&$7$/2*B'$7$ xmlns:doc="urn:sa..." xmlns=""> <I_CATALOG>COLOR</I_CATALOG> <T_QAICATAB/> <T_QIERRTAB/> </doc:QIRF_SEND_CATALOG_DATA> </body> </biztalk_1>

5HFHLYLQJ�WKH�5)&�UHVSRQVH�RI�WKH�%XVLQHVV�&RQQHFWRU�

If the call succeeds, the Business Connector answers with the result of the RFC call:

<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery/> </header> <body> <doc:QIRF_SEND_CATALOG_DATA.Response xmlns:doc="ur..." xmlns=""> <T_QAICATAB> <item> <SATZART>Q45</SATZART> <KATALGART>1</KATALGART> <CODEGRUPPE>COLOR</CODEGRUPPE> <CODE>1</CODE> <KURZTEXT>Red</KURZTEXT> <QKENNZAHL>000</QKENNZAHL> </item> </T_QAICATAB> <T_QIERRTAB/> </doc:QIRF_SEND_CATALOG_DATA.Response> </body> </biztalk_1>

Page 21: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

�� &RQILJXULQJ�WKH�%XVLQHVV�&RQQHFWRU�IRU�66/��+7736��

Before you can configure the BC for SSL, you need X.509 certificates. We can provide you with a certificate-test-package, that can be used for testing and certification. These certificates issued by ICC Walldorf can not be used in a productive environment! The following chapters describe the configuration using our certificate-test-package.

����,QVWDOOLQJ�WKH�FHUWLILFDWHV�LQWR�WKH�%XVLQHVV�&RQQHFWRU� Copy the certificates from the certificate-test-package into the following directories: cacert.der → <start_dir>\sapbc\server\config\cacert.der cacert.der → <start_dir>\sapbc\server\config\cacert\cacert.der servercert.der → <start_dir>\sapbc\server\config\cert.der serverkey.der → <start_dir>\sapbc\server\config\privkey.der Normally the Common Name in the servercert must match with the computer name, on which the BC is running. We used „localhost“ for this Common Name. If you need to use a different computer name, and if the servercert does not work, please tell us this computer name and we will send you a new server certificate.

����&UHDWLQJ�DQ�+7736�OLVWHQHU�LQ�WKH�%XVLQHVV�&RQQHFWRU� Press “Settings” on the left and then “Listeners” on the bottom of the screen. Choose “Type” = “webMethods/https” and press “Add”. Enter a port number (e.g. 4444) and fill the following fields:

“Client Authentication” = “Request client certificates”. “Server’s Certificate” = <start_dir>\sapbc\server\config\cert.der “Authorities Cert” = <start_dir>\sapbc\server\config\cacert.der “Private Key” = <start_dir>\sapbc\server\config\privkey.der “Trust Authority Dir” = <start_dir>\sapbc\server\config\cacert\

Now press “Submit” and enable the new listener by pressing the red ball-icon. The icon should turn now to green. Now whenever you establish an HTTPS-connection, the BC requests your client certificate. If you do not present one, the BC asks for username and password. If you choose “Client Authentication” = “Require client certificates”, you PXVW log on with a valid certificate.

����,PSRUWLQJ�WKH�FOLHQW�FHUWLILFDWH�LQWR�WKH�%XVLQHVV�&RQQHFWRU� To use your client certificate you must import it into the BC. Press “Access” on the left and then “Client Certificates” on the bottom. Enter the path of the clientcert.der from the certificate-test-package and press “Import”. A new certicicate with Common Name = “BC User” is added. To use the certificate for signing on you must map it with an existing BC-user. So press “View detailed/Edit” and on the next screen press “Edit mapping”. Choose a user and press save. We recommend to choose the user that corresponds with your R/3 user. Now you can use your client certificate to enter the BC administrator screen and to access functionality.

Page 22: ;0/ &RPPXQLFDWLRQ 6$3 %XVLQHVV &RQQHFWRU … · 6$3 $* ;0/ FRPPXQLFDWLRQ – %XVLQHVV &RQQHFWRU &RQILJXUDWLRQ *XLGH ˙ If you want to use the other direction as well (SAP is client),

� 6$3�$*� ;0/�FRPPXQLFDWLRQ�±�%XVLQHVV�&RQQHFWRU�&RQILJXUDWLRQ�*XLGH�

� ���

����,QVWDOOLQJ�FHUWLILFDWHV�LQWR�\RXU�:HE�%URZVHU� If you want to use HTTPS for administration, you must install the clientcert and the cacert into your web browser. If you use IE5, simply doubleclick the clientcert.p12 and the cacert.der to install them (btw: with NT4 the SP6 is needed).

�� $GGLWLRQDO�KLQWV��

1) It’s not necessary, to include empty fields in the XML document that is sent to the

Business Connector. The following two XML documents are equivalent:

<tag1>info1</tag1> <tag2/> <tag3></tag3> <table1> <item> <ti1>info2</ti1> <ti2/> <ti3/> </item> <item> <ti1/> <ti2>info3</ti2> <ti3/> </item> <item> <ti1/> <ti2/> <ti3>info4</ti3> </item> </table>

<tag1>info1</tag1> <table1> <item> <ti1>info2</ti1> </item> <item> <ti2>info3</ti2> </item> <item> <ti3>info4</ti3> </item> </table>

2) The occurence of the Idoc segments etc. is contained in the “minOccurs” and “maxOccurs” elements of the XML schema. If such an element misses, then its default value is “1”. Example: <element name="E1LFM1M" minOccurs="0" maxOccurs="9999"> the segment is optional, it can occur 9999 times. <element name="EDI_DC40"> the segment is mandatory and can occur exactly 1 times.