﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-booby325-随笔分类-webservice</title><link>http://www.blogjava.net/booby325/category/34504.html</link><description>既然已经选择了生命的远方，便只需风雨兼程</description><language>zh-cn</language><lastBuildDate>Mon, 08 Sep 2008 09:42:42 GMT</lastBuildDate><pubDate>Mon, 08 Sep 2008 09:42:42 GMT</pubDate><ttl>60</ttl><item><title>AXIS安装</title><link>http://www.blogjava.net/booby325/archive/2008/09/08/227750.html</link><dc:creator>飘逝</dc:creator><author>飘逝</author><pubDate>Mon, 08 Sep 2008 07:40:00 GMT</pubDate><guid>http://www.blogjava.net/booby325/archive/2008/09/08/227750.html</guid><wfw:comment>http://www.blogjava.net/booby325/comments/227750.html</wfw:comment><comments>http://www.blogjava.net/booby325/archive/2008/09/08/227750.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/booby325/comments/commentRss/227750.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/booby325/services/trackbacks/227750.html</trackback:ping><description><![CDATA[<p><strong>Axis简介</strong><br />
<br />
　　Axis是Apache组织推出的SOAP引擎，Axis项目是Apache组织闻名的SOAP项目的后继项目，目前最新版本是采用Java开发的1.1版本，C++的版本正在开发之中。Axis v1.1软件包可以从http://ws.apache.org/axis/dist/1_1/下载得到。</p>
<p>　　<strong>Axis的安装</strong></p>
<p>　　应用Axis开发Web Services，你需要有一个支持Servlet的服务器引擎，比如广为人知的Tomcat（Tomcat也是由Apache组织所提供的，目前的最新版本为4.1.24，下载地址为http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.24/）。在此之前当然你机器必须已经装好了JDK1.3以上的版本，当安装好Tomcat之后，只需将下载的Axis软件包解压缩，将其中的&#8220;webapps&#8221;目录下的&#8220;axis&#8221;目录整个拷贝到Tomcat安装目录下的&#8220;webapps&#8221;目录下即可。</p>
<p>　　<strong>Axis的配置</strong></p>
<p>　　Axis基于Java开发，可以部署于多种操作系统，使用前需要配置一系列的系统变量，在此假定你已经在本机上装好了Tomcat 4.0以上的版本，需要配置的系统变量如下表所示：</p>
<p><em>CATALINA_HOME<br />
C:\Tomcat_4_1</em></p>
<p><em>AXIS_HOME<br />
%CATALINA_HOME%\webapps\axis</em></p>
<p><em>AXIS_LIB<br />
%AXIS_HOME%\lib</em></p>
<p><em>AXISCLASSPATH<br />
%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</em></p>
<p><br />
　　假如你不愿做这么繁琐的类路径设置，可以直接将axis软件包中&#8220;lib&#8221;目录下的所有.jar文件加入到系统环境变量CLASSPATH中即可。</p>
<p>　　Axis的测试</p>
<p>　　安装配置完毕后，应测试一下是否Axis可以正确运行了。</p>
<p>　　启动Tomcat服务器，在浏览器中访问http://localhost:8080/axis/happyaxis.jsp，假如页面显示有错误，则需要回头检查一下相关配置是否正确，假如浏览页面能正确显示出系统组件、属性等参数配置信息，则表示安装成功，如下图所示：</p>
<p>&nbsp;<img style="border-left-color: #99cc00; border-bottom-color: #99cc00; border-top-color: #99cc00; border-right-color: #99cc00" height="436" alt="" src="http://www.blogjava.net/images/blogjava_net/booby325/20081522144740277801.jpg" width="554" border="0" /></p>
<p>　　现在可以开始开发你的Web Services应用了。</p>
<p><strong>服务的发布</strong></p>
<p>　　Axis提供了两种服务发布方式，一种是即时发布（Instant Deployment），一种是定制发布（Custom Deployment）。 </p>
<p>　　<strong>使用即时发布</strong></p>
<p>　　对即时发布的支持是Axis的特色之一，使用即时发布使用户只需有提供服务的Java类的源代码，即可将其迅速发布成Web服务。每当用户调用这类服务的时候，Axis会自动进行编译，即使服务器重启了也不必对其做任何处理，使用非常简单快捷。</p>
<p>　　使用即时发布首先需要一个实现服务功能的Java源文件，将其扩展名改为.jws（Java Web Service的缩写），然后将该文件放到&#8220;&#8230;&#8230;\webapps\axis&#8221;目录下即可。</p>
<p>　　在此给出一个从英里到公里的长度单位转换的服务，其源码如下：</p>
<p>文件Distance.jws</p>
<p>/**</p>
<p>* @author 飞鹰</p>
<p>*/</p>
<p>public class Distance</p>
<p>{</p>
<p>public double convertMile2Kilometre( double mile )</p>
<p>{</p>
<p>//实现英里到公里的距离转换</p>
<p>return mile * 1.609;</p>
<p>}//convertMile2Kilometre()</p>
<p><br />
资料引用:http://www.knowsky.com/368792.html</p>
<br />
 <img src ="http://www.blogjava.net/booby325/aggbug/227750.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/booby325/" target="_blank">飘逝</a> 2008-09-08 15:40 <a href="http://www.blogjava.net/booby325/archive/2008/09/08/227750.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>