You are on page 1of 14

Exercise 7: RFC to WebService to Retrieve ZipCode data

Overview
The purpose of this exercise is to implement a synchronous execution of a webService using
RFC from a R/3 system via XI. As a result of this exercise, you will become familiar with the basic
sequence of steps to implement a simple interface with XI along with RFC sender adapter and
SOAP receiver adapter. This exercise will also introduce import of WSDL documents into
integration repository.

SAP
R/3 4.6C

RF
C
ZipCode
ZipCodeInfo

SOAP

Internet
Application

XML Vendor Data

Prerequisites
Basic knowledge of XI architecture
Description
A WebService that is available at the following site will be invoked from R/3 system using an
RFC. The input parameter for this webService is a zipCode(US) and it returns information
regarding this zipCode like city, county, state, longitude and latitude, etc. If an incorrect zipCode
is entered an error message is returned.

Exercise steps
*Please note, as a general rule, all development and configuration objects in XI are CASESENSITIVE.
Step 1 SLD
In this exercise, we will define a software component version which will house all our
development objects. This is done in the system landscape directory (SLD). We will create a new
Software Component version. We will also define a technical system and business system for
the webService service.
In this exercise there is no need to define any software
1.1

We will be using the Product as defined before.

1.1.1

Log in to the Integration Server client via SAPGui and change your password.

1.1.2

From the main menu select Start Integration Builder (transaction SXMB_IFR). This will
launch the Integration Builder homepage in a separate window.

1.1.3

In the Integration Builder home page, select System Landscape Directory. This will
bring up the SLD in a separate window (note the URL shortcut /sld).

1.1.4

Select software catalog. The list of all products appears. Browse around the list and
inspect specific product versions by clicking on them. The details page will show you
which software components are exposed for a given product.

You can go back to the main page by clicking back to Software Catalog.
1.1.5

When you are finished browsing, from the software catalog screen select Software
Component from the drop-down list.

1.1.6

Select New Component. This will take you to the wizard for creating a new Software
Component (SWC).

1.1.7

The product we will use is called XI RIG US Workshop of vendor SAP XI RIG US.
Select this product from the drop-down list. Fill out the remaining fields as specified
below. Then click Create. Note: after the SWC is created, you will see a confirmation
message in a green box at the top of the screen. The fields of the wizard will be reset in
order to allow you to create another SWC if necessary. Click Cancel to get out of the
wizard.
Vendor:
Name:
Version:

SAP XI RIG US
XI RIG US workshop XX (replace XX with your group number).
1.0

1.2

Create technical system

1.2.1

Go to the SLD homepage (click home in the upper left corner.)

1.2.2

Choose Technical landscape. In the technical system browser, select technical system
type: third-party.

1.2.3

Select New Technical System. This will take you to the wizard.

1.2.4

For the type of technical system, select Third-Party. Click Next>

1.2.5

System Name: XIWS_legacy_TS_XX (replace XX with your group number).


Host Name:
<your host name>.
Click Next.

1.2.6

From the list of available products, select XI RIG US Workshop, 1.0 then click Add.
The product will appear in the Selected Products list. Verify that the software
component you created in the previous step is present and is checked. Click Finish.

1.2.7

Verify in the technical system browser that the newly created object appears in the list
under TS type: third-party.

1.3

Create Business System

1.3.1

In the SLD homepage, select Business Landscape.

1.3.2

Select New business system. This will take you to the wizard.

1.3.3

For the business system name, enter XIWS_legacy_BS_XX (replace XX with your group
number). Click Next.

1.3.4

As technical system type, select third-party.

1.3.5

Select your technical system

1.3.6

As logical system name, enter WS[XX] (replace XX with your group number). This will
be the ALE name of the business system.

1.3.7

In the next screen, verify that product and software component are correct. Make sure
your SWC is checked.

1.3.8

Finally, make sure that this business system is identified as an application system (as
opposed to an integration server). Choose the appropriate related integration server from
the drop-down list. Click Finish.

Step 2 Repository
2.1

From the Integration Builder home page, select Integration Repository. This will launch
the Java Web Start application. Log in with your user ID and password.

2.2

In the left-hand frame, find the software component XI RIG US workshop base comp
and expand it. In the section imported objects you will find the RFC ZMC_ZIPCODE.
Double-click on it and inspect the RFC metadata.

2.3

Under your namespace in the left frame, expand the node Interface objects.

2.4

Create under external definitions using the WSDL provided. WSDL describes a
webservice with the import of which will automatically define the request and response
data definitions.

2.4.1

Right-click on External Definitions and select New. We will create a definition called
zipCode.

2.4.2

In the Edit external definition area, using the file upload, load the zipcode.wsdl file. Make
sure the category is WSDL. Save the object.

2.5

Create a new message interface.

2.5.1

In the left frame, right-click on the node Message Interface and select New.

2.5.2

The name of the message interface will be zipCode_in.

2.5.3

Choose Inbound for the Category and synchronous for Mode in the definitions tab. The
input message type should reference the ZipCodesSoapIn from the external definitions
and output message type should reference ZipCodesSoapOut again from the external
definitions. Save the object.

2.6
2.6.1

Create a message mapping.


In the left frame right click on the node, message mappings under mapping objects and
create a new message mapping.
The name for the message mapping will be zipCode_Req. This step will map the
record structure of the RFC to the record structure of the zipcode message at the time of
the request processing.

2.6.2

2.6.3

On the left side of the mapping choose the RFC ZMC_ZIPCODE structure from the XI
RIG US workshop base comp and on the right hand side choose the external definition of
zipcodesoap_in.

2.6.4

Begin mapping and this being a request side of mapping it only has one field to map.
Save the object after mapping is done.

2.6.5

Creat another message map with the name zipCode_Resp. Since we are not changing
the output from the webService call, the mapping is pretty straight forward. The left side
of the map will be ZipCodesSoapOut and the right side of the map will be
ZMC_ZIPCODE.Response.

2.6.6

Since some the names and structures are same, we can make use of a mapping feature
wherein, the fields with same names and similar structure will get mapped automatically.
To do this, highlight the top nodes as shown above and click on
icon at the top of the
screen. All the field which have the same name will get automatically mapped.

Map the remaining field manually. Save the object.


2.7

Now create an interface mapping.

2.7.1

Create a new interface mapping zipCode_ReqResp by right clicking on the interface


mapping on the left frame.

2.7.2

As source interface, select the ZMC_ZIPCODE from the base comp SWC. For the target
interface, select zipCode_In message interface that was created earlier from your own
namespace.

2.7.3

Hit the refresh button below to populate the Source and Target messages. Provide
zipCode_Req for the Request and zipCode_Resp for the Response mapping
programs respectively.

Save the object. This concludes the steps required in Integration Builder Design.
2.7.4

Finally, in the left-hand frame, go to your change list and activate it. This concludes the
steps required in Integration Builder Design.

Step 3 Directory
3.1
3.2
3.2.1

From the Integration Builder home page, select Integration Directory.


We will be creating a new Communication Channel under M13_800 called RFC_Sender
for this exercise.
Expand Service without party in xiworkshop_groupXX and further expand Business
System and right click on Communication channel under M13_800 New.

3.2.2

Provide following parameters in the create object screen.


Communication Channel: RFC_sender and choose create.

3.2.3

In the Edit Communication Channel provide following parameters:


Adapter Type: RFC
Choose Sender
Transport protocol: RFC
Communication protocol: RFC (RFC-XML)
Adapter Engine : Integration Server

3.2.4

For the RFC Server Parameters, provide the following values.


Expand Service without party in xiworkshop_groupxx and right-click on Business
Service New.

3.3
3.4

Create a new Business Service with name zipCodeServiceProvider being added to your
scenario.

3.5

Add an inbound interface in the receiver tab. Use F4 to pull up values and select
zipCode_in inbound interface from your software component version and the right
namespace. Save the object.

3.6

Now create a communication channel. The communication channel is essentially the


physical connectivity to/from the application system. This is where the adapter
configuration takes place. In this case we need to configure the SOAP adapter to poll for
new files and send them to the Integration Server.
Expand your service and right-click on communication channel New. Name your
communication channel SOAP_Receiver.

3.6.1

3.6.2
3.6.3
3.6.4

3.6.5

3.6.6
3.7
3.7.1
3.7.2

3.7.3

For the adapter type, use the F4 help and select SOAP.
Specify Receiver since the adapter will be receiving the messages from the IS.
Specify the following parameters:
- Transport Protocol: HTTP.
- Message Protocol: SOAP 1.1
- Adapter Engine: Integration Server (you can use the central or decentral AE).
For the Connection Parameters, enter the following:
- Target URL: http://webservices.instantlogic.com/zipcodes.ils
- Proxy: Check the box. Most networks have firewalls and will be using proxies to
mask the identity for security and privacy reasons.
- Host: proxy
- Port: 8080
Save your communication channel.
Next step is to create a Sender Agreement object. This defines a binding between the
sender communication channel and the outbound interface.
On the left frame, right-click on the sender Agreement New.
Fill in the following values on the pop-up screen.

In the Edit Sender Agreement screen, use F4 to pull up values and choose
RFC_Sender as the sender communication channel. Save the object.

3.8
3.8.1
3.8.2

The next step is to create a Receiver Agreement object. This defines a binding between
the communication channel you just created, and the inbound interface.
In the left frame, right-click on Receiver Agreement New.
Specify the following parameters:
- Sender Service: M13_800
- Receiver Service: zipCodeServiceProviderXX with its appropriate namespace
- Add to Scenario: xiworkshop_groupXX and choose create.

3.8.3

In the screen Edit Receiver Agreement, use F4 help for the Receiver Communication
Channel field. Select your communication channel (SOAP_Receiver). Save and close.

3.9

From the left frame, create a new Receiver Determination object. This is the main part
of the routing process, where you assign a receiver for your message.
Select your sender service and interface

3.9.1

3.9.2

For this exercise the sender will be M13_800 business system which is an R/3
application.
In the Configured Receivers area, choose the existing service
zipCodeServiceProviderXX. Save your receiver determination.

3.10

In the following steps, you will create an Interface Determination object. Now that we
have defined a receiver for the message, we need to assign an inbound interface, and an
interface mapping (if necessary).
3.10.1 In the area Configuration Overview for Receiver Determination at the bottom of your
screen, hit refresh.
3.10.2 In the column Receiver (Partner/Service) right-click and select New Specific, in order
to create a new interface determination object.
3.10.3 You are now in the screen Edit Interface Determination. In the section Configured
inbound interfaces select the following using F4 help. When you are done, please save
the Interface Determination object.
- Inbound interface: zipCode_in
- Interface mapping: zipCode_ReqResp

3.11

Finally you will create a Receiver Agreement object. This will allow you to assign a
receiver communication channel to the receiver service/interface you have chosen.
3.11.1 Go back to the main screen for your receiver determination. In the area Configuration
Overview for Receiver Determination at the bottom of the screen, hit Refresh.
3.11.2 In the column Receiver Determination (Communication Channel) right click and select
New Specific.
3.11.3 In the screen Edit Receiver Agreement, for the field Receiver Communication Channel
use the input help (F4), and select the communication channel SOAP_Receiver. Save
the Receiver Agreement.
3.12

Go back to the main receiver determination screen and refresh. Your configuration is
now complete and activate your objects.

Step 4 Testing
4.1 Testing is very straight forward for this exercise. Go to SE37 transaction in M13 system and
input ZMC_ZIPCODE for the Function Module name. Execute (F8).
4.2 Input any valid zip code in the zipcode field for ex, 08817, and also provide a destination
name of RFC2XIXR3 for the RFC target system. Hit execute.

4.3 Upon execution all the integration server steps will be carried out and a webService call using
SOAP adapter should be made and the results will be displayed.

Appendix: naming conventions and terminology


Exercise 1
Area
SLD

Int. Rep.

Int. Dir

R/3
File sys

Obj. type
TS
BS
Log.Sys.
SWC
NS
Data type
Msg.type
Msg.int.
Msg.map
Int.map
scenario
service
Send c.c.
Rec. c.c.
IDoc
Log.Sys.
folder

Object name
XIWS_legacy_TS_XX[00..30]
XIWS_legacy_BS_XX[00.30]
XIWS_XX
XI RIG US workshop [00..30]
urn:xiworkshop:groupXX[00..30]:legacy
Vendor_DT
Address_DT
Vendor
Vendor_out
Vendor_CREMAS03
Vendor_out_CREMAS03
xiworkshop_groupXX[00..30]
XIWS_legacy_BS_XX[00..30]
File_sender
XIWS_IDoc_receiver
CREMAS.CREMAS03
WSXX[00..30]
\\hostname\workshop\groupXX[00..30]

Description
Technical system for legacy app
Business system for legacy app
Logical system name for BS
Individual SWC for exercises
Namespace for legacy objects
Vendor data type
Nested DT
Vendor message type
Message interface
Message mapping
Interface mapping
Common for all exercises
Derived from BS (no party)
Sender comm. channel
Receiver c.c. used for workshop
Vendor master data
Same as above
D:\workshop\groupXX[00..30]

You might also like