Blogs

Hans-Joachim Odlozinski

SAP Co-Innovation Lab Architecture Series: Partner-delivered Enterprise Services - Implementing Services in Java (Part 6)
Hans-Joachim Odlozinski SAP Employee
Business Card
Company: SAP AG
Posted on Jun. 19, 2009 01:13 AM in Service-Oriented Architecture, Business Process Expert, Composition Environment (CE), Java Programming, SAP Developer Network, SAP NetWeaver Platform, Co-Innovation Lab

Subscribe.Subscribe
Print. Print
Permalink Permalink

image

The previous blogs of this series focused on modeling and defining services using the Enterprise Services Builder which is part of the Enterprise Services Repository toolset. Starting with this blog we will show you in the following three blogs how the design time WSDL created during this process may be implemented using different technologies: JEE, .NET and ABAP.

This blog will show you the detailed steps of how to implement the Read Sales Order service using JEE technology on SAP NetWeaver Composition Environment 7.1 EhP 1. The development toolset is provided within SAP NetWeaver Developer Studio.

So continue on your PdES journey and have a look at the screencam:

 

image

 

The detailed storyboard is outlined in the following:

 

Steps in SAP NetWeaver Developer Studio:

 

  • Configure the connection to the Enterprise Services Repository
  • Configure the connection to the SAP NetWeaver Composition Environment 7.1 EhP 1 server
  • Configure web services runtime
  • Create a JEE project
  • Create an EJB project
  • Import WSDL from Enterprise Services Repository into EJB project
  • Generate Java Skeleton for imported WSDL
  • Implement Java Skeleton
  • Build and Deploy JEE application

Steps in SAP NetWeaver Administrator:

 

  • Configure web service endpoint
  • Test web service using Web Services Navigator

 

For more details on providing stateless web services see SAP Help Portal. Navigate to Providing, Discovering and Consuming Services -> Providing Web Services -> Providing Web Services in Java Applications -> Providing Stateless Web Services 

 

Below you find the sample code used in the service implementation implementing the skeleton method readSalesOrder(...):

 

//Creating a sample Sales Order structure:
SalesOrderByIDResponseMessageSync out_MDT = new SalesOrderByIDResponseMessageSync();

SlsOrdByIDRespMsgSyncSlsOrd out_MDT_SlsOrd = new SlsOrdByIDRespMsgSyncSlsOrd();
out_MDT_SlsOrd.setID(salesOrderByIDQuery_sync.getSalesOrderSelectionByID().getID());

XMLGregorianCalendar calendar = new XMLGregorianCalendarImpl(new GregorianCalendar());
out_MDT_SlsOrd.setDate(calendar);

List out_MDT_item= new ArrayList();
SlsOrdByIDRespMsgSyncSlsOrdItm item = new SlsOrdByIDRespMsgSyncSlsOrdItm();
item.setID("10");
out_MDT_item.add(item);
out_MDT_SlsOrd.item = out_MDT_item;

out_MDT.setSalesOrder(out_MDT_SlsOrd);

//Create a log element reflecting successful processing:
//[For documentation see SAP GDT catalog in PDF version on sdn.sap.com]
NOSCLog log = new NOSCLog();

log.setBusinessDocumentProcessingResultCode("3");
log.setMaximumLogItemSeverityCode("1");

List logItemList = new ArrayList();

NOSCLogItem logItem = new NOSCLogItem();
logItem.setSeverityCode("1");
logItem.setNote("Read operation for sales order was successful.");
logItemList.add(logItem);
log.item = logItemList;

out_MDT.setLog(log);

return out_MDT;

 

The correct usage of the Log data type for non-technical error reporting is described in the corresponding section in the SAP Global Data Type catalog in PDF format.

 

Ride in the tube of SOA and learn how to deliver your services based on SAP's modeling and definition methodology. Stay tuned for more information and move on in your PdES journey with the next blog on "Implementing Services in .NET".

In the following the links to all other blogs from the PdES Architecture Series (Not all blogs are published yet):

  1. Introducing the Storyboard
  2. Outlining the ‘Way to Deliver' SAP methodology-compliant Services
  3. Modeling Services
  4. Defining Services
  5. Leveraging a wizard to automate Service Creation
  6. Implementing Services in Java (This Blog)
  7. Implementing Services in .NET
  8. Implementing Services in ABAP
  9. Custom Development delivered custom enterprise services
  10. Summarizing the PdES Architecture Series

Hans-Joachim Odlozinski is a senior solution architect at SAP's Global Co-Innovation Lab Network.


Add to: del.icio.us | Digg | Reddit


Comment on this article
Comment on this weblog