26
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

(is) Consuming XI Web Service in Java WebDynpro Application

Embed Size (px)

DESCRIPTION

(IS) Consuming XI Web Service in Java WebDynpro application

Citation preview

Page 1: (is) Consuming XI Web Service in Java WebDynpro Application

Consuming XI Web Service in Java WebDynpro applicationBy 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    

Page 2: (is) Consuming XI Web Service in Java WebDynpro Application

Create Message

Types: 

Page 3: (is) Consuming XI Web Service in Java WebDynpro Application

 

Create Message Interface

 

Create Mappings for Request and Response

Page 4: (is) Consuming XI Web Service in Java WebDynpro Application

 

 

Create Interface Mapping

Page 5: (is) Consuming XI Web Service in Java WebDynpro Application

 

Save and Activate all the Objects in IR.

Click here to continue...

Page 6: (is) Consuming XI Web Service in Java WebDynpro Application

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

Page 7: (is) Consuming XI Web Service in Java WebDynpro Application

 

Create a Sender Agreement

 

Create a Receiver Agreement 

Page 8: (is) Consuming XI Web Service in Java WebDynpro Application

Create a Receiver Determination 

 

Create a Interface Determination 

Page 9: (is) Consuming XI Web Service in Java WebDynpro Application

 

The below screenshot shows all the Objects under Configuration Scenario. 

 

Now Define a Web service as shown in the Screenshot 

Page 10: (is) Consuming XI Web Service in Java WebDynpro Application

 

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.

Page 11: (is) Consuming XI Web Service in Java WebDynpro Application

Click here to continue...

Page 12: (is) Consuming XI Web Service in Java WebDynpro Application

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 Developer’s Studio) 

Create a new WebDynpro Project 

 

Enter the Project Name for JavaWebDynpro and say Finish. 

 

Now Create a Model

Page 13: (is) Consuming XI Web Service in Java WebDynpro Application

 

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.

Page 14: (is) Consuming XI Web Service in Java WebDynpro Application

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

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

Page 15: (is) Consuming XI Web Service in Java WebDynpro Application

 

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 

Page 16: (is) Consuming XI Web Service in Java WebDynpro Application

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.

Page 17: (is) Consuming XI Web Service in Java WebDynpro Application

 

Select the Attributes to bind to bind them to form elements 

 

In the Editor Column select InputField  

Page 18: (is) Consuming XI Web Service in Java WebDynpro Application

 

At last my Layout for StartView looks like

 

For ResultView:

Outbound plug: ToStartView

Inbound plug: FromStartView 

Actions for ResultView:

 

Create a Layout for ResultView

Page 19: (is) Consuming XI Web Service in Java WebDynpro Application

 

Select the Attributes to bind to bind them to form elements 

 

In the Editor Column select TextView 

Page 20: (is) Consuming XI Web Service in Java WebDynpro Application

 

At last my Layout for StartView looks like 

 

Check the Diagram View  

Click here to continue...

Page 21: (is) Consuming XI Web Service in Java WebDynpro Application

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. 

Page 22: (is) Consuming XI Web Service in Java WebDynpro Application

 

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. 

Page 23: (is) Consuming XI Web Service in Java WebDynpro Application

 

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("PISUPER");wdContext.currentRequest_CDWS_MI_CDWS_MIElement().modelObject()._setPassword("xxxxxxxx"); //$$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 

Page 24: (is) Consuming XI Web Service in Java WebDynpro Application

 

After creating the Application Save the object’s 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. 

Page 25: (is) Consuming XI Web Service in Java WebDynpro Application

 

Response from RFC via XI (PI)

 

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