webservice to webservice synchronous scenario

Upload: krishnamf01

Post on 13-Apr-2018

272 views

Category:

Documents


5 download

TRANSCRIPT

  • 7/27/2019 WebService to WebService Synchronous Scenario

    1/27

    WebService to WebService Synchronous scenario

    By Pravesh Sharma, CSC

    Scenario: -

    This document is made to explain the WebService to WebService Scenario using SAP XI as anEnterprise Application Integration (EAI) platform.

    We are sending two numbers from a WebService Client Application using sender SOAP adapter tothe Integration server. This input message is sent to the Receiver WebService using receiver SOAPadapter whose wsdl is imported in XI as an external definition and WebService is sending responseback.

    System Message Flow:-

    SOAP-XI-SOAP scenario

    Introduction:-

    Configuring Sender SOAP adapter so that the message from the WebService Client Application canbe transformed to the Integration Server. We are using receiver SOAP adapter and Web Service tosend the response back.

    Web Services are a standard format for exchanging data. The standard is based on XML

    and consists of a SOAP envelope with a header and a body. The XI system allows creating a WSDLfile from an interface description and uploading a WSDL file.

    Prerequisites:-

    1) Business system is created in SLD (We will be using Business System E11BS as theReceiver Service. We will create Fn. Module in XI System that is why we are using E11BSBusiness System).

    2) Software Component and namespace is created in which development has to be done.

    3) WebService Client Application (Altova XML Spy) is available to send request to theIntegration Server.

    STEPS:

    Create a Remote-Enabled Function Module having two Import parameters of type INT4 and an Exportparameter of type INT4.This Function Module will be exposed as a Web Service.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    2/27

    Add the source code for the Function Module.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    3/27

    To develop Web Service choose Utilities (M) More Utilities

    Create Web Service

    From theFunction Modulefrom the main menu.

    Follow the Wizard for Web Service creation.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    4/27

    Enter the Service Definition. This will be the name of our Web Service.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    5/27

    Enter the name of the Function Module and click the checkbox Mapping der Namen

  • 7/27/2019 WebService to WebService Synchronous Scenario

    6/27

    Select Profile as Basic Authorization: SOAP Profileand click the checkbox Release Service forRuntime for releasing the Web Service for SOAP Runtime. We can also release our Web Serviceusing the transaction WSCONFIG.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    7/27

  • 7/27/2019 WebService to WebService Synchronous Scenario

    8/27

    This completes the process of creating Web Service

    Now open Object Navigator (SE 80)and open Enterprise Services

    Service Definitionsandselect the Web Service we have created.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    9/27

    Here we can see three tabs: Property, Interface and Variant.

    Property tab contains attributes of the Web Services.

    UnderInterfacetab we can see the Input and Output parameters as the Import and Export

    parameters of our Function Module.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    10/27

    The Varianttab defines various variants of the Web Service. Default Variant is created with the samename as that of the Web Service. We can create also addition variants.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    11/27

    In transaction WSCONFIGwe can check whether the Web Service is released for SOAP runtime andthe Configuration of Web Service is consistent or not.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    12/27

    In Transaction WSADMINwe can test our Web Service in WSNAVIGATOR orWeb ServiceHomepage by clicking the icon.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    13/27

    Enter the credentials for of the Server on which Web Service is developed.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    14/27

    Copy the WSDL linkas it will be user during the configuration time in the Integration Directory.

    ss

  • 7/27/2019 WebService to WebService Synchronous Scenario

    15/27

    Here we can Test our Web Service whether it is working fine or not.

    Click on the WSDL linkand save the contents of the wsdl file on Local folder as it will be used during

    Design Time in Integration Repository.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    16/27

  • 7/27/2019 WebService to WebService Synchronous Scenario

    17/27

    Open the Software Component

    Software Component Version

    Namespace in which we wantto create the Design Objects.

    Create new External Definitionunder Imported Objects.

    Now open Design: Integration Builder (Integration Repository)

    Click the Import External Definitionlink and import the WSDL filethat was saved previously on theLocal Folder.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    18/27

    On the Messagestab we can see two messages. One is the Request message and the other one isthe Response message for the Web Service.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    19/27

    Now we start creating the Data Types for the source message.

    Create new Data Type Training_Input_DT. This Data Type will serve the purpose of Web ServiceClient Applications request.

    Create another Data Type Training_Output_DT. This Data Type will serve the purpose of responseto Web Service Client Application.

    Now we create the Message Typesfor the source message.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    20/27

    Create new Message Type Training_Input_MTand encapsulate the Data Typecreated in theprevious step for request

    Create another Message Type Training_Output_MT and encapsulate the Data Typecreated in the

    previous step for response.

    Now we create the Message Mappingbetween the Request MessageTypes.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    21/27

    Select or drag and drop the source request MT Training_Input_MT. Select the target message asthe request message ZTrainingAddof the external definition Z_TRAINING_SERVICE.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    22/27

    Now

    map N1 to NUM1and N2 to NUM2

  • 7/27/2019 WebService to WebService Synchronous Scenario

    23/27

    For the Web Service response create a message mapping with source message as the Web

    Service response ZTrainingAddResponseand the response Message TypeTraining_Output_MT.

    Both of the Request and Response mappings will be used in Interface Mapping.

    Now create a Message Interfaceof CategoryOutbound andModeSynchronous. Select OutputMessage asTraining_Input_MTand Input Message as Training_Output_MT.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    24/27

  • 7/27/2019 WebService to WebService Synchronous Scenario

    25/27

    Similarly create another Message Interfacehaving Category Inbound andMode Synchronous.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    26/27

    We can select the request and response messages from the External Definition.

    Now we create the Interface Mapping Training_WS_To_WS_IMbetween the Source/Outboundand Target/Inbound Interfaces.

    On pressing the Read Interfaces buttonit will automatically populate the Source and TargetMessages that we have defined in the Message Interfaces. Select the Request MessageMappingfor Request buttonand Response Message Mappingfor Response Button.

  • 7/27/2019 WebService to WebService Synchronous Scenario

    27/27

    This completes our Design Time activity in Integration Repository.