tomcat中部署webservice

博客介绍了WebService相关操作。首先是安装Axis,需复制相关文件到指定目录,部署实例并启动服务器,还可进行测试;接着给出了服务端的service代码示例,包含service程序和bean程序;最后提到写deploy.wsdd和进行部署。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 安装Axis
  1. copy /webapps/axis/WEB-INF/lib 下的文件到自己的instance的lib下,比如,你的app名为: webservice,那么copy到/webapps/webservice/WEB-INF/lib
  2. copy happyaxis.jsp及其它便于管理的jsp及class到webservice的目录下
  3. deploy webservice instance and start web server
  4. 使用http://127.0.0.1:8080/webservice/happyaxis.jsp测试axis engine
2. 写server端的service代码,例子如下
service 程序:

package com.mot.helium.ws;

public class ContentOperation {
 public void publishContent(ContentRequestBean requestObj){
  System.out.println();
 }
}

bean 程序:

package com.mot.helium.ws;

 public class ContentRequestBean {
 
 private int id;
 private int contentType;
 private String contentName;
 
 public String getContentName() {
  return contentName;
 }
 /**
  * @param contentName The contentName to set.
  */
 public void setContentName(String contentName) {
  this.contentName = contentName;
 }
 /**
  * @return Returns the contentType.
  */
 public int getContentType() {
  return contentType;
 }
 /**
  * @param contentType The contentType to set.
  */
 public void setContentType(int contentType) {
  this.contentType = contentType;
 }
 
 /**
  * @return Returns the id.
  */
 public int getId() {
  return id;
 }
 /**
  * @param id The id to set.
  */
 public void setId(int id) {
  this.id = id;
 }
     }

3. 写deploy.wsdd
 
4. deploy:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值