You are on page 1of 54

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.

Click here to continue...

WebService to WebService Synchronous scenario


...Previous
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.

Click here to continue...

WebService to WebService Synchronous scenario


...Previous
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.

Click here to continue...

WebService to WebService Synchronous scenario


...Previous
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.

Click here to continue...

WebService to WebService Synchronous scenario


...Previous
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
N1 to NUM1and N2 to NUM2

Click here to continue...

map

WebService to WebService Synchronous scenario


...Previous
For the Web Service response create a message mapping with source message as the Web
Service response ZTrainingAddResponse and the response Message Type Training_Output_MT.
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.


Click here to continue...

WebService to WebService Synchronous scenario


...Previous
Now we open the Integration Builder:
theConfiguration Scenario for the Interface.

Configuration

(Integration

Directory) for

creating

First we will add a Business System that acts as the Receiver Service.
Go to Objects tab and select the Business System E11BS that we want to add to our scenario. Right Click
and select Add to Scenario.

Now create the Business Service SOAP_Request_BS that acts as the Sender Service.

Add the Sender/Outbound Interface to this service.

Now we will start creating the Communication Channels. As it is a Web service to Web service Interface,
both sender and receiver adapters will be SOAP adapters. First we will configure theReceiver SOAP
Adapter.
Select the Adapter type as SOAP and check the Receiver radio button. Enter the URL of the WSDL
in Target URL and click the Configure User Authentication and provide the credentials of the Server
where the Web Service has been deployed.
http://acadnt11:8000/sap/bc/srt/rfc/sap/ZPS_ADDITION_WS?sap-client=001&wsdl=1.1

Similarly we can configure the Sender SOAP adapter and provide the Default Interface Namespace and
Default Interface Name. Quality of Service will be Best Effort as it is a Synchronous communication.
Click here to continue...

WebService to WebService Synchronous scenario


...Previous
Now we create the Sender Agreement .Specify the Sender Service and Sender/Outbound Interface.

Specify the Sender Communication Channel as Sender_SOAP_CC which we have configured in previous
screen shots.
Create the Receiver Determination which specifies the Party or Service that is going to be the receiver of
this message.

Specify the Receiver Service E11BS in Configured Receivers as the receiver of the messages.
Now create the Interface Determination which specifies the Inbound Interface and theInterface
Mapping for message transformation.

Now as we can see in the screen shot above the Inbound Interface and Interface Mapping are assigned
under Service E11BS.
Now we create the Receiver Agreement which determines which Inbound Interface and Receiver
Communication Channel will transform the message so that it can be processed by the receiver.

Specify the Receiver Communication Channel that we have configured in the previous screen shots.

Click here to continue...

WebService to WebService Synchronous scenario


...Previous
Now we create the WSDL for Sender/Outbound Interface. Select ToolsDefine Web Service It will start
a wizard for defining a Web Service for the Outbound Interface.

Enter the URL as


http://Hostname:J2EEPort/XISOAPAdapter/MessageServlet?channel=:<Sender
Communication Channel>

Service>

:<

Sender

So in our case the URL will be


http://acadnt11:50000/XISOAPAdapter/MessageServlet?channel=:SOAP_Request_BS:Sender_SOAP_CC
http://acadnt11:50000/XISOAPAdapter/MessageServlet?channel=:SOAP_Request_BS:Sender_SOAP_CC
http://sapd07ci:56100/XISOAPAdapter/MessageServlet?channel=:BSV_FILE_TEST_SENDER:CC_SOAP_
SENDER_TEST

Enter the Outbound Interface Name, Namespace and Software Component Version and click Continue.

Specify the Sender Party (if any), Sender Service, Outbound Interface and Interface Namespace and
click Continue.

Click Finish to create the Web Service document.

Click here to continue...

WebService to WebService Synchronous scenario


...Previous
Now we have to save the wsdl file generated to the Local Folder. This wsdl file will be used for sending
Request from Web Service Client Application.

This is how our complete Configuration Scenario will look like in Integration Directory.
Now we can test our scenario Web Service to Web Service communication by sending the request
using Altova XML Spy or any other Web Service Client Application.
Go to SOAP in the main menu and select Create new SOAP Request.

Browse the wsdl file that we have saved on the local folder.

Click here to continue...

WebService to WebService Synchronous scenario


...Previous
Once we have selected the wsdl file click OK button.
Now we can see our request message in file Untitled1.xml

Select SOAP Send request to server to send this message to XI Server.

Enter the Username and Password for the Server.

This displays the result back from SAP XI.

Now we can monitor the message in SAP XI using transaction SXMB_MONI. or SXI_MONITOR.

This is the XML version of the request which was sent.

This one is the XML version of the response that is received from the Receiver Web Service.

This completes our Design, Configuration and Runtime activities for the Interface Web Service to Web
Service communication using SAP XI as an EAI technology.

You might also like