您的位置:首页 >> 编程开发 >> Java >> J2EE >> 正文
RSS
 

Extend Your J2EE Applications into Web Services

http://www.rdxx.com 05年08月10日 20:30 Java频道 我要投稿

关键词: Web Services , J2EE , extend , ATI , NT , ONS , CE , Web
any view Web services as the backbone to a new generation of cross-platform, cross-language distributed computing applications. In fact, Sun defines Web services as "a well-defined, modular, encapsulated function used for loosely coupled integration between applications or systems components."

This industry buzz explains why many businesses want to extend their existing J2EE applications to Web services applications, which would allow them to leverage the functionality of J2EE while reaping the benefits of Web services. To that end, Apache's latest SOAP engine, Apache eXtensible Interaction System (Axis), not only enables developers to build new Web service applications from scratch but also provides the infrastructure to publish existing Java classes as Web services.

This article demonstrates how to create a Web service application from an existing J2EE application using Oracle OC4J J2EE application server and Apache Axis. With downloadable source code, it provides a step-by-step tutorial for building a simple J2EE application and then Web-service enabling it with Axis.

Build a J2EE Application
Although this article uses Oracle OC4J application server, feel free to use your own app server. Without delving too deeply into the details of building a J2EE application, the sample code defines a simple session bean (MyBean.java) with two methods (click here to download the source code):

public interface MyEJB extends EJBObject {  public String toUpperCase(String s) throws RemoteException;  public String reverse(String s) throws RemoteException;}

The implementation of these methods in MyEJBBean.java is straightforward:

public String toUpperCase(String s) {	if (s==null)	  return null;	else	  return s.toUpperCase();}public String reverse(String s){ if (s==null)	  	  return null; else return new StringBuffer(s).reverse().toString();}


 
 
标签: Web Services , J2EE , extend , ATI , NT , ONS , CE , Web 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站