Home arrow Web Services arrow Page 4 - Deploying an EJB Application
WEB SERVICES

Deploying an EJB Application


This article shows you how to deploy an EJB application, and more. Picking up where the previous article left off, it is the third of three parts. It is excerpted from chapter 7 of the book Building Web Services with Java: Making sense of XML, SOAP, WSDL, and UDDI, written by Steve Graham et al. (Sams; ISBN: 0672326418).

Author Info:
By: Sams Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 10
June 01, 2006
TABLE OF CONTENTS:
  1. · Deploying an EJB Application
  2. · Configuring Axis to Invoke the SkatesService Session Bean
  3. · EJB Wrap-Up
  4. · JSR109 Client Code

print this article
SEARCH DEVARTICLES

Deploying an EJB Application - JSR109 Client Code
(Page 4 of 4 )

Another aspect of JSR109 is the support for managing clients, which would have helped with the test client we wrote earlier. JSR109 allows any managed Web service client to be configured outside the code. In the same way that references to datasources, EJBs, URLs, and so on can be managed by the container, 109 also supports this for service-refs (resource refs to Web services). This works for EJBs, servlets, or J2EE application clients (known as thick or managed clients) making calls to Web services. The benefit is that a reconfiguration of the application can retarget the Web service—including changing the WSDL and the list of JAX-RPC handlers to be called (JAX-RPC handlers are components that are run outside the application logic and can modify or look at the SOAP message).

In this model, the client code would look like:

Service sps = ic.lookup("java:comp/env/
skatesProductsRef"); SkatesProducts sp =
sps.getPort(SkatesProducts.class); sp.addProduct(...)

JSR109 Wrap-Up

JSR109/WSEE offers a well-defined way to deploy Web services into an application server. Effectively, it standardizes much of what Axis does in a J2EE environment. The benefits to the developer and deployment engineer are knowing that the applications and deployment will be portable across application servers, and some simplification—for example, the requirement to package and deploy Axis as a Web application is removed. JSR109 also offers a managed client environment that allows Web services to be referred to logically using the service-ref capability. In the future, these facilities will be enhanced by the Web Services Meta-data for Java standard (JSR181). JSR181 allows programmers to annotate their code with meta-data tags that define how the code will be deployed as a service, or use Web services.

Summary

In this chapter, we've shown how Enterprise JavaBeans can be exposed as Web services. The two approaches show that Axis can be used to expose EJBs as services, providing a way of exposing existing or newly created EJB business objects over SOAP; and that JSR109 provides a simpler, more integrated approach to exposing stateless session beans as Web services, using a DD and inbuilt J2EE 1.4 capabilities.

Using J2EE as a development environment for services adds both standardization and enhanced quality of service. However, the real benefit comes when you're building complex applications that integrate across reliable, transactional, and secure environments.

Resources

  • J2EEhttp://java.sun.com/j2ee

  • JSR109http://www.jcp.org/en/jsr/detail?id=109


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
WEB SERVICES ARTICLES

- Dealing with Loose Coupling in a Service-Ori...
- Loose Coupling in a Service-Oriented Archite...
- Safety, Idempotence, and the Resource-Orient...
- The Resource-Oriented Architecture in Action
- Features of the Resource-Oriented Architectu...
- The Resource-Oriented Architecture
- Getting Started with Flex
- Automated Billing and Faxing for the Web
- An Introduction to Web Services
- The Foundations of Web Services: From Novice...
- Web Services Reengineering: Finishing Touches
- Fault Handling with Web Services
- Flow and Web Services
- Process Lifecycles and Web Services
- Business Processes and Web Services

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials