Use Axis2 develop WebServices in Eclipse

简介:
Axis2, what's that?
At first, we should pay enough sight to Axis2, as which home page say that "
Apache Axis2 is the core engine for Web services. It is a complete re-design and re-write of the widely used Apache Axis SOAP stack."
 
And this describe
" Apache Axis2 not only supports SOAP 1.1 and SOAP 1.2, but it also has integrated support for the widely popular REST style of Web services . The same business logic implementation can offer both a WS-* style interface as well as a REST/POX style interface simultaneously.
 
 Apache Axis2 is more efficient, more modular and more XML-oriented than the older version. It is carefully designed to support the easy addition of plug-in "modules" that extend their functionality for features such as security and reliability. "
 
More info can find in
Ok, let's show we case of this cool tool, please allow me call she like this.
 
Case
Here we will implement an CalculateService, which include plus,minus,multiply and divide method.
And we use axis2 1.4.1 to deploy as an Web service.
 
Follow me, let's do it!
 
setp one
Before you do it, you should download axis2 1.4.1 from http://ws.apache.org/axis2/index.html
 
download this version named "axis2-1.4.1-bin.zip", then unzip it to some dirctory, here i use "E:\Java_dev\axis2-1.4.1".
 
setp two
Setting your eclipse's webservices "axis2 preferences" item, set which runtime to E:\Java_dev\axis2-1.4.1, and now the whole setting is over, next setp is to make this CalculateService.
 
setp three
create an java project, and create an java class named CalculateService, code detail like this
package rong.service; 

/** 
*    
* @author daniel zhou 
* 2009-07-22 
*/
 
public  class CalculateService { 

   /** 
    * plus 
    * @param x 
    * @param y 
    * @return 
    */
 
   public  float plus( float x,  float y) { 
     return x + y; 
  } 

   /** 
    * minus 
    * @param x 
    * @param y 
    * @return 
    */
 
   public  float minus( float x,  float y) { 
     return x - y; 
  } 

   /** 
    * multiply 
    * @param x 
    * @param y 
    * @return 
    */
 
   public  float multiply( float x,  float y) { 
     return x * y; 
  } 

   /** 
    * divide 
    * @param x 
    * @param y 
    * @return 
    */
 
   public  float divide( float x,  float y) { 
     return x / y; 
  } 


}
 
setp four
When service is over, now we will create it as an web service,
select project and new an other, select "web services".
Attention:
  • In "Sevice implementation" should locate to your just create java class.
  • select your web container (must select runtime to axis2) and select at "start service" point.
  • client type selct web container (must select runtime to axis2)  and "test client" point 
then "next", if you want to create client serive, ok, choose it and next, then all is setting over, start server!
 
Then you will find in you jboss's deploy dirctory, two ear package have been deployed!
 
if you intersted in it, can open ear and have a look.
 
setp five
when server is started, which will open an browser, in which window, it have some test for you to do, like set x=2, and y=33, and click "go" button, the reslut will be show 35 to you!
It cool!
 
Ok, do by yourself, good luck!




    本文转自danni505 51CTO博客,原文链接:http://blog.51cto.com/danni505/181891,如需转载请自行联系原作者

相关文章
|
6月前
|
Android开发
Eclipse提示“The default workspace “xxxx” is in use or cannot be created Please choose a different on
Eclipse提示“The default workspace “xxxx” is in use or cannot be created Please choose a different on
|
Java Android开发
没解决:eclipse的JDK Compliance的Use compliance from execution无法选中
没解决:eclipse的JDK Compliance的Use compliance from execution无法选中
103 0
|
Android开发 数据格式 XML
Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
今天在做自定义ViewGroup中,出现了一下错误提示Use View.isInEditMode() in your custom views to skip code when shown in Eclipse具体解决方法:在eclipse error log中查看错误具体出现在哪一行,然后将if (isInEditMode()) { return; }加入即可。
939 0
|
Web App开发 Java 应用服务中间件
在Eclipse中创建基于Axis2的web services
本实验的目的是让你尽可能快的创建使用 Axis2 的服务和客户端,我们将使用一个简单的 SayHello 服务并显示给你一些创建和部署它的不同方式,以及了解 Axis2 自带的一些工具,然后我们将看看创建访问这些服务的客户端。
728 0
|
Web App开发 Android开发
Axis2与Eclipse整合开发
[图解教程] Axis2与Eclipse整合开发Web Service之一:简单的计算服务例子 时间:2009-07-02 16:55    来源:未知    作者:admin CSDN IE QQ 百度 我挖 Google POCO Yahoo 新浪 365Key 天极 和讯 博拉 Live 奇客 鲜果 收客 饭否 叽歪 挖客 核心提示:系统功能: 开发一个计算器服务CalculateService,这个服务包含加(plus)、减(minus)、乘(multiply) 、除(divide)的操作。
709 0
|
6月前
|
Java Maven Android开发
在Eclipse里配置Maven插件
Maven是一款比较常用的Java开发拓展包,它相当于一个全自动jar包管理器,会导入用户开发时需要使用的相应jar包。使用Maven开发Java程序,可以极大提升开发者的开发效率。下面我就跟大家介绍一下如何在Eclipse里安装和配置Maven插件。
154 0
|
6月前
|
XML Java Maven
eclipse 、idea 安装activiti插件
eclipse 、idea 安装activiti插件
162 0
|
11月前
|
Java Android开发
eclipse安装SpringBoot插件的无敌办法
eclipse安装SpringBoot插件的无敌办法
131 0

推荐镜像

更多
下一篇
无影云桌面