This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
This HOWTO shows how to wrap any ABAP RFC-Call into a Web Service that can even be used on a Java-Mobile-Phone.
Author: Rene Pilz
Company: SFS Services AG, Heerbrugg, Switzerland
Created on: 25. February 2010
Author Bio
SAP PI Specialist at SFS Services AG, Heerbrugg, Switzerland. We wad the first productive SAP XI Installation within Switzerland. Currently we have up to 400 Partner-Connections with any possible format (EDIFACT, ANSI, XML, CSV, FIXED-Length,…). Also responsible for Mobile Development Team just started.
How to Wrap any ABAP-RFC-Call into a Web Service Using PI 7.x
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
Download RFC-Information from R/3 System .................................................................................................... 4
Create Web Service Request and Response Structure ..................................................................................... 6
Create Web Service Interface............................................................................................................................. 6
The Message Mappings (request and response) ............................................................................................... 7
The Operation Mapping ...................................................................................................................................... 7
Configurations within Integration Directory (integration builder)......................................................................... 8
Related Content ................................................................................................................................................ 11
Disclaimer and Liability Notice .......................................................................................................................... 12
How to Wrap any ABAP-RFC-Call into a Web Service Using PI 7.x
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
We create a Web Service with PI 7.x. This Web Service is wrapped around a RFC-Call to the ABAP-Stack. So you can wrap any RFC-Call into a Web Service and use this for example on a mobile phone.
See also the Source-Forge Project xmlnodeparser which provides a lightweight SOAP-Client that can run on any Java-Capable Mobile Phone (even those without JSR 172 - Web Services).
Our scenario is as following:
1. Web Service Client (i.e. Java Mobile Phone) sends a request to SAP PI
2. SAP PI takes out the XML Payload and calls a RFC Function for example on a SAP R/3 System
3. The response of this function call is taken back from the PI
4. The response is wrapped into the Web Service Response and sent back to the Web Service Client
Note: On the PI System this is realized as a synchronous interface, meaning the Web Service Client immediately gets its
Before you can use a RFC from an R/3 (or lets say: ABAP) System you have to download its configuration:
Just go into the Enterprise Services Builder and choose the Software-Component you wish (we always create one Software-Component for the R/3-Systems) and set up the connection to your ABAP-System:
Now you can right-click on "Imported Objects" and choose "Import SAP Objects":
How to Wrap any ABAP-RFC-Call into a Web Service Using PI 7.x
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
Within the sender agreement you can choose in the menu:
Sender agreement show WSDL
Please use only this WSDL because all others (there are many places within the PI where you can create one!!) are not complete.
Tests, Troubleshooting
Now you can use the WSDL with any usable Webservice Client (i.E. Netweaver Developer Studio). Alternative you can also go to
http://<host>:<port>/wsnavigator
where host is your PI hostname and port your Java-WAS port
Here you can enter the WSDL-URL as shown within the Sender Agreement and test the WSDL.
Normally synchronous calls which are successfully are not shown with PI Transaction SXMB_MONI, but you can set the following parameters within Integration Engine - Administration (TA SXMB_ADM):
How to Wrap any ABAP-RFC-Call into a Web Service Using PI 7.x
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.