(is) Publishing Interface as Web Service (Web Service to RFC Scenario)

Embed Size (px)

Citation preview

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    1/14

    Publishing Interface as Web Service (Web Service to RFC)

    By Neeraja Surapaneni, YASH Technologies

    This step-by-step document describes how to publish the Interface as web service from XI.

    Business process:

    In this example we are publishing outbound interface as web service. When the interface is defined as webservice in the Integration directory, it will generate a WSDL document. Using this WSDL we can createSOAP request with the help of third party tools like XML SPY or Microsoft InfoPath. When this SOAP requestis send to the XI system it will invokes the RFC ZSYNCGETSFLIGHTDET_E6S_800 in SAP R/3 systemand this RFC returns the response back to the SAP XI. The SAP XI collects the response and maps to theWSDL response, which in turn is sent back to third party system XML SPY or Microsoft InfoPath.

    About RFC

    The RFC ZSYNCGETSFLIGHTDET_E6S_800 when executed on E6S system client 800 with importparameters CONNID and CARRID checks whether the combination exist in SAP database table SFLIGHT ornot? If the combination exists then it will return FLAG as 0 otherwise returns FLAG as 4.

    1. Create RFC in the R/3 system

    First we need to create the RFC ZSYNCGETSFLIGHTDET_E6S_800 in R/3 system with import parametersas CONNID, CARRID and export parameters as CONNID, CORRID and FLAG.

    Go to Transaction SE37 to create RFC.

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    2/14

    2.

    Design the interfaces in Integration Repository

    Start up the home page of the Exchange Infrastructure Tools using transaction SXMB_IFR. Click on theIntegration Repository under Integration builder.

    2.1 Import RFC:-Import the RFC that we have created in the above step from the corresponding R/3system. To import RFC right click on RFCs which is under the Imported Objects under the Softwarecomponent version.

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    3/14

    When we import RFCs we will get both Request messages and Response messages. This importedRFC can be used as Message Interface.

    2.2

    Define Request and Response Data Types:- Define a new data types for each Request and

    Response messages of imported RFC.

    The structure of Request data type should resemble Import parameters of RFC

    The structure of Response data type should resemble Export parameters of RFC.

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    4/14

    2.3 Define Request and Response Message Types:-

    Create Request Message Type by encapsulating Request data type.

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    5/14

    Now create Response Message Type by encapsulating Response datatype.

    2.4 Create outbound synchronous Message Interface

    We aregoing to publish this Outbound Message Interface as Web service in Integration Directory. Oncewe define this interface as web service it will generate WSDL file. Using this file we can create a SOAPrequest using third party tools like XML SPY or Microsoft Info path.

    2.5 Create Message mappings

    Here we need to create two message mappings, the first mapping is between Request messagetype and RFC Request message and the second mapping is between RFC Response message andResponse message type.

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    6/14

    Request message mapping

    Response message mapping

    2.6 Create Interface mapping

    As the Interface is Synchronous it will ask for the Request and Response

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    7/14

    Activate all the changes by clicking on Change lists tab.

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    8/14

    Click here to continue...

    http://www.saptechnical.com/Tutorials/XI/WebService2RFC/page2.htmhttp://www.saptechnical.com/Tutorials/XI/WebService2RFC/page2.htmhttp://www.saptechnical.com/Tutorials/XI/WebService2RFC/page2.htm
  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    9/14

    Publishing Interface as Web Service (Web Service to RFC)

    ...Previous

    3. Configurations in the Integration Directory

    In the Integration Repository first we need to create one Business service, as the sender is SOAP and importthe Business system from the SLD as the receiver is RFC.

    3.1 Create Business service and communication channel

    Right click on the Business service to create a new Business service

    Right click on the communication channel to crate communication channel for SOAP sender

    3.2 Import Business system and create receiver RFC communication channel

    http://www.saptechnical.com/Tutorials/XI/WebService2RFC/page1.htmhttp://www.saptechnical.com/Tutorials/XI/WebService2RFC/page1.htmhttp://www.saptechnical.com/Tutorials/XI/WebService2RFC/page1.htm
  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    10/14

    3.3 Create Sender agreement, Receiver determination, Interface determination and Receiveragreement

    Sender agreement

    Receiver agreement

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    11/14

    Interface determination

    Receiver determination

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    12/14

    3.4

    Define web service

    To define the web service, select define web service from the tools menu

    It will take you to the wizard, which enables you to create web service documents in WSDL.

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    13/14

  • 8/10/2019 (is) Publishing Interface as Web Service (Web Service to RFC Scenario)

    14/14

    Now click on continue then Finish button. It will generate the WSDL document. Save the document forfurther processing.

    3. Test the Scenario

    In order to test this scenario we need third party tools like XML Spy or Microsoft InfoPath.

    In this example we are using XML SPY to create and send SOAP request from the generated WSDL.

    Open XML spy editor to create a SOAP request from the WSDL generated above.

    Input Xml File

    SOAP-ENV:Envelopexmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/ "xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    AHAA

    Send the SOAP Request to ServerTools->SOAP->Send Request To ServerOutput XMl File(response)

    000000004

    http://schemas.xmlsoap.org/soap/envelope/http://schemas.xmlsoap.org/soap/envelope/http://schemas.xmlsoap.org/soap/envelope/http://www.w3.org/2001/XMLSchema-instancehttp://www.w3.org/2001/XMLSchema-instancehttp://www.w3.org/2001/XMLSchema-instancehttp://www.w3.org/2001/XMLSchema-instancehttp://www.w3.org/2001/XMLSchema-instancehttp://www.w3.org/2001/XMLSchema-instancehttp://schemas.xmlsoap.org/soap/envelope/