Java资源网

| JAVA基础 | 环境配置 | JDBC | 线程技术 | Socket编程 | JavaMail | JAVA与XML | 设计模式 | 技术新闻 | Java认证 | 程序人生 软件下载
| JSP&Servlet | Spring | Struts | Hibernate | JBuilder | Eclipse | WebService | EJB技术 | J2ME开发 | 应用服务器 | JXTA | Ajax
Articles search文章搜索
   关键字:
   类 别:
       
New download 最新下载
· [组件]HTML Parser 1.5
· [教程]WebSphere Studio应用教程
· [组件]JDom 1.0
· [工具]Junit3.8.1
· [教程]EJB编程及J2EE系统架构和设计
· [教程]EJB教程
· [教程]J2EE Tutorial中文版
· [教程]Java编程思想2(英文)
· [教程]java编程思想(完整版)
· [教程]Java网络编程
New articles 最新文章
· 设计移动 Web 服务
· 解析XML的时候完全忽略DTD
· 理解XML Schema XML Schema 初步
· 标签库的深入研究
· 提升JSP应用程序的七大绝招
· 如何使用JDOM对XML文件进行操作
· 处理XML字符串中特殊字符
· 利用Digester把XML转换成为Java对象
· 使用WebService 和RMI远程协作
· 使用Axis开发Web Service程序
Articles top 热门文章
· Eclipse基础--plugin插件安装(6644)
· eclipse+tomcat+lomboz的安装配置说明(4774)
· Java程序员就业前景(4584)
· Windows下JAVA环境变量的设置祥解(3788)
· Tomcat下JSP、Servlet和JavaBean环境的配置(3716)
· 使用links方式安装Eclipse插件(3698)
· 一个老程序员的心理话(3533)
· linux下jdk的安装与配置(3459)
· 初学者入门:Structs中基本配置入门(3334)
· Eclipse 运行命令行参数大全(3084)
您的位置:首页>>应用服务器>>批量安装部署web service到axis server
批量安装部署web service到axis server
2005-08-01   来源:CSDN  作者:chinamao

环境:
先取的如下软件:
1.tomcat 5.0.28
2.axis-1_2alpha.zip

将axis-1_2alpha.zip解压到d:\目录,将里面的webapps下的axis整个目录copy到tomcat的webapps下。
重起tomcat后在地址栏输入http://localhost:8080/axis/可以看到
如下画面就说明axis app 部署成功:

Apache-AXIS

Hello! Welcome to Apache-Axis.

What do you want to do today?

  • Validate the local installation's configuration
    see below if this does not work.
  • View the list of deployed Web services
  • Call a local endpoint that list's the caller's http headers (or see its WSDL).
  • Visit the Apache-Axis Home Page
  • Administer Axis
    [disabled by default for security reasons]
  • SOAPMonitor
    [disabled by default for security reasons]

To enable the disabled features, uncomment the appropriate declarations in WEB-INF/web.xml in the webapplication and restart it.

Validating Axis

If the "happyaxis" validation page displays an exception instead of a status page, the likely cause is that you have multiple XML parsers in your classpath. Clean up your classpath by eliminating extraneous parsers.

If you have problems getting Axis to work, consult the Axis Wiki and then try the Axis user mailing list.




然后点击
Validate,校验是否axis可以工作
如果出错的话会提示你少那些包,并提示到那里取得这些包,这些包分为两类core(核心)和option(可选)
本人少了一个和core lib和2个option
core:
activation.jar

option:
xmlsec.jar
mail.jar

上网取得这些包放到axis app的lib下或tomcat 的common\lib下重起tomcat就可以看到axis可以正常工作的提示。

设置环境变量:
做为学习,可以自己写一个setpath.bat的文件,设置好axis的axisclasspath:
本人的axis解压到d:\axis目录下,所以setpath文件如下:
setpath.bat

set AXIS_HOME=D:\axis
set AXIS_LIB=%AXIS_HOME%\lib
set AXISCLASSPATH=%AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery.jar;%AXIS_LIB%\commons-logging.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\xml-apis.jar;%AXIS_LIB%\xercesImpl.jar


注意第一行和和第二行的后面都应该没有空格,否则会导致AXISCLASSPATH错误;执行改bat

部署webservice:

我们要部署为webservic的文件在d:\axis\samples下,现在我们部署该目录下的stock目录下面的application

在确保你的tomcat已经启动,并且你的axis app 已经在http://localhost:8080/axis/下

进到d:\axis\samples\stock目录下
执行如下代码:

java -cp %AXISCLASSPATH% org.apache.axis.client.AdminClient -lhttp://localhost:8080/axis/services/AdminService deploy.wsdd

如果期间出现classnotfind之类的错误,检查你的环境变量有没有错(通常会有一些空格,或者打错字的错误)
如果提示connect refuse,则是tomcat没启动,或http://localhost:8080/axis/services/AdminService 不能工作

部署成功的话,查看{axis app}/web-inf 下多了一个文件server-config.wsdd,这个文件是web service的deploy desciptor.

测试部署成功的web service:

回到AXIS_HOME目录下,执行:
java -cp .;%AXISCLASSPATH% samples.stock.GetQuote -lhttp://localhost:8080/axis/servlet/AxisServlet -uuser1 -wpass1 XXX

见结果如下:

D:\axis>java -cp .;%AXISCLASSPATH% samples.stock.GetQuote -lhttp://localhost:808
0/axis/servlet/AxisServlet -uuser1 -wpass1 XXX
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectR
esourceBundle).
log4j:WARN Please initialize the log4j system properly.
XXX: 55.25




下面是将axis集成到你自己的app里

  1. Advanced Installation: adding Axis to your own Webapp

    If you are experienced in web application development, and especially if you wish to add web services to an existing or complex webapp, you can take an alternate approach to running Axis. Instead of adding your classes to the Axis webapp, you can add Axis to your application.

    The core concepts are

    1. Add axis.jar, wsdl.jar, saaj.jar, jaxrpc.jar and the other dependent libraries to your WAR file.
    2. Copy all the Axis Servlet declarations and mappings from axis/WEB-INF/web.xml and add them to your own web.xml
    3. Build and deploy your webapp.
    4. Run the Axis AdminClient against your own webapp, instead of Axis, by changing the URL you invoke it with.

    The process is also covered in Chapter 15 of Java Development with Ant, which can be downloaded as a PDF file.

  --相关文章--
· 开源技术:tomcat5.0下配置ssl (2007-04-17)
· 开源技术基础:TOMCAT的用法 (2007-04-17)
· 开源技术之Tomcat数据源配置总结 (2007-04-17)
· 实例讲解配置之——TOMCAT集群配置 (2007-04-17)
· 实例讲解Apache+tomcat+ssl配置 (2007-04-17)
· 如何同时启动多个Tomcat服务器 (2007-04-17)

版权所有©2005-2006 JAVA资源网 渝ICP备05007591号 虚拟主机 | 关于我们 | 联系方式 | 广告业务 | 网站地图 | 友情链接