Axis1开发WebService服务端及客户端

参考文档  http://ws.apache.org/axis/java/user-guide.html
http://www.cnblogs.com/hoojo/archive/2010/12/20/1911349.html

http://www.ibm.com/developerworks/cn/webservices/ws-axisfaq/index.html

http://mljavalife.iteye.com/blog/1182063

http://tech.ccidnet.com/art/3737/20050612/470685_1.html


下载 axis-1.4.zip 文件并解压。设置axis的环境变量 "AXIS_HOME"

服务端


根据给定wsdl 生成axis1服务端命令:


    java -Djava.ext.dirs=%AXIS_HOME%\lib org.apache.axis.wsdl.WSDL2Java <wsdl地址> -o <%Output_Path%> -d Session -s -S true -p <%Package%>
将java的方法,用axis1.4的命令生成WSDL文件命令java2wsdl.bat

set Axis_Lib=E:\apache-tomcat-6.0.32\webapps\axis\WEB-INF\lib
    set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%
    %Java_Cmd% org.apache.axis.wsdl.Java2WSDL -o HelloImpl.wsdl -l "http://localhost:8080/axis/services/HelloImpl" -n "urn:HelloImpl" -p"axis.wsdd" "urn:HelloImpl444444" axis.wsdd.HelloImpl
    pause;
web.xml 加入如下代码

<servlet>
    <servlet-name>AxisServlet</servlet-name>
    <display-name>Apache-Axis Servlet</display-name>
    <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>AdminServlet</servlet-name>
    <display-name>Axis Admin Servlet</display-name>
    <servlet-class>org.apache.axis.transport.http.AdminServlet</servlet-class>
    <load-on-startup>100</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/servlet/AxisServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>*.jws</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AdminServlet</servlet-name>
    <url-pattern>/servlet/AdminServlet</url-pattern>
  </servlet-mapping>
WebService部署 ( 需要服务器上先启动WEB应用)

利用deploy.wsdd 自动部属生成 server-config.wsdd  配置文件 命令

java -Djava.ext.dirs=%AXIS_HOME%\lib org.apache.axis.client.AdminClient deploy.wsdd -l http://192.168.69.69:7001/vombsWeb/services/AdminService
把服务器上生成的 server-config.wsdd  拷贝下来
最后WEB工程(axis1服务端) 目录结构如下:

WebContent
       |-- WEB-INF
       |-- classes
       |-- lib                   添加 axis1 的jar包
       |-- server-config.wsdd    描述文件 利用deploy.wsdd生成
       |-- web.xml
监听WebService命令

java -Djava.ext.dirs=%AXIS_HOME%\lib org.apache.axis.utils.tcpmon
axis1.4生成客户端命令

java -Djava.ext.dirs=%AXIS_HOME%\lib org.apache.axis.wsdl.WSDL2Java <wsdl地址> -o <%Output_Path%> -p <%Package%>
问题总结:

运行的时候,有 警告,错误 如下:
org.apache.axis.utils.JavaUtils isAttachmentSupported
- Unable to find required classes (javax.activation.DataHandler and javax.mail.i
nternet.MimeMultipart). Attachment support is disabled.


解决办法:
  将“activation.jar”和“mail.jar”包拷贝到lib。






转载于:https://my.oschina.net/whp/blog/96077

以下的资源也很不错, 加减可以看一下o 使用C++制作戰車射擊-100%提供源码 http://download.csdn.net/source/2257663 使用C++制作3D动画人物-100%提供源码 http://download.csdn.net/source/2255453 Linux kernel 每一行都完全注释-初学者必备 http://download.csdn.net/source/1982431 Programming Embedded Systems 2nd http://download.csdn.net/source/1982338 J2ME pdf and code 郭克华 http://download.csdn.net/source/2229809 C语言程序设计(Visual+C 6.0环境) http://download.csdn.net/source/2232878 Visual C++ 60 MFC + code 学习最强宝典 http://download.csdn.net/source/2236266 ASP.NET Web (第一次亲密接触ASP.NET) http://download.csdn.net/source/2241466 1 Introduction 1-1 11 Motivation 1-1 12 Objective of the Specification 1-2 13 Scope of the Document1-2 14 USB Product Compliance1-2 15 Document Organization1-3 16 Design Goals1-3 17 Related Documents1-3 2 Terms and Abbreviations 2-1 3 USB 30 Architectural Overview 3-1 31 USB 30 System Description 3-1 311 USB 30 Physical Interface3-2 3111 USB 30 Mechanical3-2 312 USB 30 Power 3-3 313 USB 30 System Configuration3-3 314 USB 30 Architecture Summary3-3 32 SuperSpeed Architecture 3-4 321 Physical Layer 3-5 322 Link Layer 3-6 323 Protocol Layer3-7 324 Robustness3-8 3241 Error Detection 3-8 3242 Error Handling 3-9 325 SuperSpeed Power Management3-9 326 Devices3-10 3261 Peripheral Devices 3-10 3262 Hubs3-11 327 Hosts 3-12 328 Data Flow Models3-12 4 SuperSpeed Data Flow Model 4-1 41 Implementer Viewpoints 4-1 42 SuperSpeed Communication Flow4-1 421 Pipes4-2 43 SuperSpeed Protocol Overview 4-2 431 Differences from USB 204-2 4311 Comparing USB 20 and SuperSpeed Transactions4-3 4312 Introduction to SuperSpeed Packets4-4 44 Generalized Transfer Description4-4 441 Data Bursting4-5 442 IN Transfers4-5 443 OUT Transfers4-6 444 Power Management and Performance4-7 Universal Serial Bus 30 Specification, Revision 10 viii 445 Control Transfers4-8 4451 Control Transfer Packet Size 4-8 4452 Control Transfer Bandwidth Requirements 4-8 4453 Control Transfer Data Sequences4-9 446 Bulk Transfers4-9 4461 Bulk Transfer Data Packet Size 4-9 446
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值