Prisca MOINE The Road to OSS/J SOA

Thursday Jul 06, 2006

I explain here the broad outline of exposing an enterprise application as web service with JAX-WS. More precisely, I detail the different steps to follow to convert an existing J2EE 1.4 application, namely the Sun TroubleTicket (OSS/J API, JSR 91) Reference Implementation 1.0.1, as a web service.

JAX-WS is a tool that helps you to create a web service by converting XML data into Java instances or vice versa. It offers two ways for creating a web service:
- a) either from the service description (WSDL file), it generates the web service implementation ("wsimport" tool);
- b) or from the Java Bean implementing the web service (endpoint class), it generates the service description ("wsgen" tool).
In each case, web service artifacts are generated. There are java classes enabling at runtime the transposition between XML (more precisely SOAP messages) and Java objects (corresponding instances).

Because of the legacy, I use here the second approach. The objective is actually that clients -i.e. telecommunication service providers- can reuse their existing systems. They want them to be exposed as web services to be able to plug them into an ESB, aiming at building a SOA OSS system.

Now, starting with the Java implementation to generate the WS artifacts, there is still two approaches:
- either to interface the existing Session Bean: it means to create a new EJB 3.0 (required by JAX-WS ) for the web service implementation, exposing the desired web methods, this EJB 3.0 will then communicate with the existing Session Bean;
- or to interface directly the existing entity bean (bean called by the session bean): it implies to convert the existing Session Bean in the web service implementation (in annotated EJB 3.0) so that the web service implementation class access directly the entity bean.
Here I choose to implement the first solution : it has indeed the advantage that the application can be accessed by two ways: as a web service thanks a SOAP message over HTTP or as a classical enterprise application by a classical client such as a servlet, an applet, Corba Remote Call, etc.

The web service exposition is composed of three main steps, each one detailed in the next posts:
1. Creation of the Web Service implementation class
2. Annotation of the code
4. Test of the exposed Web Service

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed