| 首页 | 电脑常识 | 程序设计 | 操作系统 | 语法 | 病毒安全 | 软件教程 | 硬件 | 数据库 | 多媒体 | 认证 | 下载 | 
首页>>程序设计 >>J2EE
Extend Your J2EE Applications into Web Services

Extend Your J2EE Applications into Web Services

电脑学习网,xuef.com,最全最新最权威的电脑知识网站.
免费计算机学习教程,电脑入门指南.
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();
}

相 关 文 章
  • java 规范(三)

  • JAVA环境配置大全

  • java入门与加深

  • 运用Jakarta Struts的七大实战心法

  • JAVA运行环境和J2EE运行环境的搭建

  • 如何掌握Java(J2SE篇)

  • Oracle Increases Enterprise Java Beans Support @ JDJ

  • Oracle to Spearhead Eclipse Project to Support EJB 3.0 @ JDJ

  • Shouldnt J2EE Be More Like Java?

  • Whats In A Name: Is This The End Of J2EE? @ JDJ

  • 学府网电脑学习的乐园
    中国电脑教学网,电脑爱好者的乐园,做最好最全的计算机学习网站.