Вы находитесь на странице: 1из 25

Consuming XI Web Service in Java WebDynpro application

By Kalyan Chakravarthy, Fujitsu Consulting India Ltd


Steps to configure the scenario:
Step1: Create a Synchronous Scenario (SOAP to RFC) and Generate WSDL in PI7.0
Step2: Import the WSDL in NWDS and Create Views in NWDS
Step3: Deploy the Java Web Dynpro in J2EE Engine.
Step4: Test the Scenario.
Steps in detail:
Step1: Create a Scenario SOAP to RFC and Generate WSDL in PI7.0
When we send a Customer Number as Request to RFC it has to fetch the Customer Details as Response.
Configure SLD as per the requirement and Import the BAPI in IR: BAPI_CUSTOMER_GETDETAIL2
Create Data Types

Create Message
Types:

Create Message Interface

Create Mappings for Request and Response


Create Interface Mapping

Save and Activate all the Objects in IR.
Click here to continue...























Consuming XI Web Service in Java WebDynpro application
...Previous
Now Log in to Integration Directory and Create a Configuration Scenario
Create Business Service and Create Communication Channels
Create a Communication Channel of type SOAP as Sender with QOS = BE

Create a Communication Channel of type RFC as Receiver

Create a Sender Agreement

Create a Receiver Agreement

Create a Receiver Determination

Create a Interface Determination

The below screenshot shows all the Objects under Configuration Scenario.

Now Define a Web service as shown in the Screenshot

Enter the below path by giving the host and port details
http://<Hostname>:<Port>/XISOAPAdapter/MessageServlet?channel=:BS_CDWS:CC_soap_sender

Now save the wsdl.

Click here to continue...























Consuming XI Web Service in Java WebDynpro application
...Previous
Step2: Import the WSDL in NWDS and Create Views in NWDS
Now got to the NWDS (Netweaver Developers Studio)
Create a new WebDynpro Project

Enter the Project Name for JavaWebDynpro and say Finish.

Now Create a Model

Select Import Web Service Model and Say Next

Enter the Model Name, Model Package and select the radio button of Local File System or URL and say
Next.

Import the WSDL file (Which was created in PI(XI))

Check the path of the Target Address by clicking on Logical Ports.

Create two Views called StartView and ResultView

Create outbound plug and Inbound plug by right clicking on View
For StartView:
Outbound plug: ToResultView
Inbound plug: FromResultView
Actions for StartView:

Layout for StartView:
Create a Layout for Start View
Click on the root element and say Apply Template

Now select Form and say Next.

Select the Attributes to bind to bind them to form elements

In the Editor Column select InputField

At last my Layout for StartView looks like

For ResultView:
Outbound plug: ToStartView
Inbound plug: FromStartView
Actions for ResultView:

Create a Layout for ResultView

Select the Attributes to bind to bind them to form elements

In the Editor Column select TextView

At last my Layout for StartView looks like

Check the Diagram View

Click here to continue...



Consuming XI Web Service in Java WebDynpro application
...Previous
In the Diagram View for a Component, Choose Component Controller right click and say Apply Template

Now select Service Controller and say Next

Now select the Model class for the Model binding and a method called
executeRequest_CDWS_MI_CDWS_MI will be generated.

Check the Context Elements you want to bind.

Using Data link connect the StartView and Component Controller and also do Context Mapping.
Later Using Data link Connect ResultView and Component Controller and also do Context Mapping.
Using Data link Connect Component Controller and Model (FujitsuModel) and also do Context Mapping..
After doing above steps the total Diagram View looks like in below screenshot.

Add few coding lines for method executeRequest_CDWS_MI_CDWS_MI( ) as follows
This coding lines are mandatory to communicate with XI(PI).We should mention the userid and password for
XI system.
public void executeRequest_CDWS_MI_CDWS_MI( )
{
//@@begin executeRequest_CDWS_MI_CDWS_MI()
wdContext.currentRequest_CDWS_MI_CDWS_MIElement().modelObject()._setUser("PISUPE
R");
wdContext.currentRequest_CDWS_MI_CDWS_MIElement().modelObject()._setPassword("xx
xxxxxx");
//$$begin Service Controller(-1540004708)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{

wdContext.currentRequest_CDWS_MI_CDWS_MIElement().modelObject().execute();
//
wdContext.nodeResponse().invalidate();
wdContext.nodeResult().invalidate();

}
Step3: Deploy the Java Web Dynpro in J2EE Engine.
Create an Application

After creating the Application Save the objects and say
Deploy New Archive and Run

Enter the SDM Password to deploy JavaWebDynpro in to J2EE Engine.

Step 4: Test the Scenario
After Successful Deployment Enter the Customer Number and say GetDetails now the response from RFC
via XI (PI) will be found in next view.

Response from RFC via XI (PI)

Now check the Message Processing in SXMB_MONI of XI (PI).

Вам также может понравиться