Wednesday, March 18, 2009

SAP XI / PI Create Inside-Out Services


Overview



- Business application in java (POService.java) to handling purchase order requests
- Two Java bean classes for purchase order and purchase order line item (purchaseOrder.java, purchaseOrderLineItem.java)
- New->Project->Java->Java Project (yes to java perspective)
- Package: com.wavecross.sn.bl New->Package

Create a new Java class

Name: POService.java

package com.wavecross.sn.bl;
public class POService {
public POService() { }
public void handlePORequest(PurchaseOrder po) {
// process purchase data // ..
}
}

PurchaseOrderLineItem.java
public class PurchaseOrder implements java.io.Serializable { private String id;
private PurchaseOrderLineItem [] items;
private String buyer;
private String seller;
}

PurchaseOrder.java
package com.wavecross.sn.bl;
public class PurchaseOrderLineItem implements java.io.Serializable {
private String id;
private String product;
private String amount;
}

Both implement
java.io.Serializable
for Web Service usage.
The getter and setter methods
can be generated using the
context menu

Generating the Web Service
- Change Web Services Perspective: Window->Open Perspective->Java Explorer
- In context menu of POService.java, New->Web Service
- Enter WS name, modify config (SOAP)
- Wizard Created:
- Virtual Interface (VI)
- Web Service Configuration (WSC)
- Web Service Definition (WSD)

Activating and Deploying Web Service
- To deploy WS app to SAP WAS, first ensure connectivity info for J2EE engine is correctly set up.
- Window->Preference->SAP J2EE Engine
- The app can now be
- Deployed using the
- Deploy option in the
- Context menu of
- InsideOut.ear

Develop the Mediated Web Service
- Capture the WS metadata into SAP XI and then expose the metadata as a mediated Web Service
- Download WSDL using WebServices Navigator (used to view a listing of deployed WS in SAP WAS)
- Open: http://[hostname]:[port]wsnavigator/enterwsdl.html
- Click POWebService to see a overview
- Standard WSDL for all WS frameworks. SAP WSDL has additional features

Create Namespace in XI
- Design objects are built in Integration Builder: Design tool
- http://:/rep/start/index.jsp
- XI uses namespaces to avid naming conflicts. All design objects be part of Software Component Version (SCV)
- This is the only way by which the XI design objects can be shipped or moved from a dev system to a test system (SRM SERVER 5.5 SCV used)
- New namespace: http://yourcompany.com/xi/XI/InsideOut
- SCV context menu->Open

Create External Definition in XI
- SAP SRM SERVER->http://yourcompany.com/xi/XI/InsideOut->Interface Objects->External Definition
- Context menu->New->Enter SRM2SN_POService
- Select imported wsdl for Category (porttypes/POWSConfig_POWebServiceVi_document.wsdl
- Save and make a note of messages

Activate changes
- Objects edited or saved are not available for XI Integration Directory
- Changes must be activated
- Changed objects are organized by SCV in Change Lists tab

Create Message Interfaces in XI
- Message interfaces are the standard and platform-independent format for representing interfaces in XI
- XI is the broker, needs inbound and outbound interfaces. Modes: Synchronous or Asynchronous; types: Inbound, Outbound, Abstract
- InterfaceObjects->Message" hyperlinktype="url">InterfaceObjects->Message" target=_parent>http://yourcompany.com/xi/XI/InsideOut->InterfaceObjects->Message Interface
- New and enter name, select Category and Mode (Outbound)

Generate WSDL for Mediated Web Service
- All message interfaces can be exposed as mediated Web Services
- WSDL can then be used by clients to consume the Web Service
- Configuration objects are built in XI’s Integration Builder:Configuration tool
- http://[hostname]:[port]/rep/start/index.jsp
- Configuration objects to be built: sender and receiver Communication Channels, Receiver Determination, Interface Determination, and Receiver Agreement.
- After this, the Web Service Wizard can be used to generate the WSDL for mediated Web Service
- Tools->Define Web Service menu

- Specify the URL of Web Service
- http://[hostname]:[port]/XISOAPAdapter/MessageServlet/channel=[party]:[ServiceName]:[ChannelName]

- Make the selection
- Enter: Service-POService; Interface Name – SN_POService_Out; Interface Namespace – http://yourcompany.com/xi/XI/InsideOut

2 comments:

  1. Awesome blog thanks for sharing from Sankar

    ReplyDelete
  2. Hi

    You provided best information about sap xi-pi on u r blog.it is very help full to sap xi pi learners.sap xi pi is the one of the best module in sap technologies.we provides SAP XI-PI Online Training

    ReplyDelete