You are on page 1of 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 an
Enterprise Application Integration (EAI) platform.
We are sending two numbers from a WebService Client Application using sender SOAP adapter to
the Integration server. This input message is sent to the Receiver WebService using receiver SOAP
adapter whose wsdl is imported in XI as an external definition and WebService is sending response
back.
System Message Flow:-

SOAP-XI-SOAP scenario
Introduction:Configuring Sender SOAP adapter so that the message from the WebService Client Application can
be transformed to the Integration Server. We are using receiver SOAP adapter and Web Service to
send 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 WSDL
file from an interface description and uploading a WSDL file.
Prerequisites:1)

2)
3)

Business system is created in SLD (We will be using Business System E11BS as the
Receiver Service. We will create Fn. Module in XI System that is why we are using E11BS
Business System).
Software Component and namespace is created in which development has to be done.
WebService Client Application (Altova XML Spy) is available to send request to the
Integration Server.

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

Add the source code for the Function Module.

To develop Web Service choose Utilities (M) More UtilitiesCreate Web ServiceFrom the
Function Module from the main menu.

Follow the Wizard for Web Service creation.

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

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

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

This completes the process of creating Web Service


Now open Object Navigator (SE 80) and open Enterprise Services Service Definitions and
select the Web Service we have created.

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


Property tab contains attributes of the Web Services.
Under Interface tab we can see the Input and Output parameters as the Import and Export
parameters of our Function Module.

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

In transaction WSCONFIG we can check whether the Web Service is released for SOAP runtime and
the Configuration of Web Service is consistent or not.

In Transaction WSADMIN we can test our Web Service in WSNAVIGATOR or Web Service
Homepage by clicking the icon.

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

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

ss

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

Click on the WSDL link and save the contents of the wsdl file on Local folder as it will be used during
Design Time in Integration Repository.

Open the Software Component Software Component VersionNamespace in which we want


to create the Design Objects.
Create new External Definition under Imported Objects.

Now open Design: Integration Builder (Integration Repository)


Click the Import External Definition link and import the WSDL file that was saved previously on the
Local Folder.

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

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 Service
Client Applications request.

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

Now we create the Message Types for the source message.

Create new Message Type Training_Input_MT and encapsulate the Data Type created in the
previous step for request

Create another Message Type Training_Output_MT and encapsulate the Data Type created in the
previous step for response.

Now we create the Message Mapping between the Request MessageTypes.

Select or drag and drop the source request MT Training_Input_MT. Select the target message as
the request message ZTrainingAdd of the external definition Z_TRAINING_SERVICE.

Now
map N1 to NUM1and N2 to NUM2

For the Web Service response create a message mapping with source message as the Web
Service
response ZTrainingAddResponse and
Training_Output_MT.

the

response Message

Type

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

Now create a Message Interface of Category Outbound and Mode Synchronous. Select Output
Message as Training_Input_MT and Input Message as Training_Output_MT.

Similarly
create
Mode Synchronous.

another Message

Interface having

Category Inbound and

We can select the request and response messages from the External Definition.
Now we create the Interface Mapping Training_WS_To_WS_IM between the Source/Outbound
and Target/Inbound Interfaces.

On pressing the Read Interfaces button it will automatically populate the Source and Target
Messages that we have defined in the Message Interfaces. Select the Request Message
Mapping for Request button and Response Message Mapping for Response Button.

This completes our Design Time activity in Integration Repository.