Building the Service Layer in Java |
|
| The service layer of SOA applications is built using Java’s comprehensive platform. The following table provides the list of APIs available in the J2EE 1.4 to build web services applications |
|
| JavaAPIs |
Description |
| JAXP |
Java API for XML Parsing |
| JAXB |
Java API for XML Binding |
| JAX-RPC (JSR 101) |
Java API for XML-Remote Procedure Call |
| SAAJ |
SOAP API for Attachments in Java |
| JAXR |
Java API for XML Registries |
| JSR 109 |
Web Services Deployment Model |
| EJB 2.1 |
Stateless Session EJB Endpoint Model |
|
|
| Of the above JAX-RPC is can be thought of as the core API for building and deploying web services with J2EE. JAX-RPC hides from the developer the complexity of mapping between the XML types and the Java types, as well as the lower level details related to the handling of XML soap messages. JAX-RPC introduces a method call serves as a paradigm by providing two programming models: A Server-side model for developing Web services end points using Java classes or stateless EJB components and a client side model for building the Java clients that access these web services as local objects. The JAX-RPC 1.1 requires the use of SOAP1.1 and interoperability with other web services which may have been built with different technologies like .Net, Cobol, C++ etc. Several J2EE-1.4-compliant application servers, such as Oracle Application server container for J2EE, Sun One Application server and web sphere support JAX RPC. |
|
| Business Process Layer |
| SOA helps you build a new application from existing services. By a process called Service orchestration, the standardization of Business process modeling is achieved. By building a web service based layer of abstraction over the legacy systems, they can be leveraged to assemble business processes that can be executed by an OASIS standard named Business Process Execution Language (BPEL) a programming language that is represented in XML. |
|
| Shown below is an example of the WSDL for the “Time Service” web service which includes the port, operations, and message types. |
|
| Shown below is an overview of a BPEL-defined process: |
<process>
<!– Definition and roles of process participants -->
<partnerLinks> ... </partnerLinks>
<!- Data/state used within the process -->
<variables> ... </variables>
<!- Properties that enable conversations -->
<correlationSets> ... </correlationSets>
<!- Exception handling -->
<faultHandlers> ... </faultHandlers>
<!- Error recovery – undoing actions -->
<compensationHandlers> ... </compensationHandlers>
<!- Concurrent events with process itself -->
<eventHandlers> ... </eventHandlers>
</process> |
|
| BPEL provides: |
 |
Partner links for the services with which the process interacts. |
 |
Variables for the data to be manipulated. |
 |
Correlations to correlate messages between asynchronous invocations. |
 |
Faults for message definitions for problems. |
 |
Compensation handlers to execute in the case of problems. |
 |
Event handlers that let the process deal with anticipated events in a graceful fashion. |
|
|
| Creating business processes using from a GUI design tool such as the Oracle BPEL Designer is a relatively simple task if you understand your business processes and you've deployed services available for your use |
|
| Presentation Layer: |
| From a user perspective the Presentation layer is very important. This layer can be built with technologies such as JSP, JSF, portlets, or standalone Java clients. Several Model-View-Controller (MVC) frameworks allow for loose coupling between the view, or presentation layer, and the model that supplies the data and business logic. Though this helps us achieve the type of loose coupling we require between the presentation layer and the service layers, we encounter a problem in that there is no standard way of binding the data between the different clients. |
|
| The data binding of services for J2EE applications are standardized using JSR-227 and defined through a set of XML-based metadata definitions. Using JSR-227, data controls are created for a business service which could be a web service, a stateless EJB or a standard Java class. The created data control describes the attributes and operations supported by the service using the XML metadata. |
|
| Binary Spectrum, a Microsoft Gold certified partner and a member of theSun Partner Advantage Programhas years of expertise in designing and developing custom software and integrated solutions, the services include various types of SOA implementations Enterprice Service Bus (ESB) implementations and Java Composite Application Platform Suite (CAPS) implementations, device integration and, help desk management, inventory and stock control, manufacturing requirement process, client appointment management, document reference and encyclopedia search engines. |
|
|