<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>lizongbo at 618119.com &#187; WebService</title>
	<atom:link href="http://618119.com/tag/webservice/feed" rel="self" type="application/rss+xml" />
	<link>http://618119.com</link>
	<description>工作,生活,java,apache,tomcat,Resin,mina,Hessian,Openfire,XMPP,RPC,Ubuntu</description>
	<lastBuildDate>Sat, 21 Aug 2010 08:34:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>基于Axis的WebService测试,开发,部署</title>
		<link>http://618119.com/archives/2007/12/28/54.html</link>
		<comments>http://618119.com/archives/2007/12/28/54.html#comments</comments>
		<pubDate>Fri, 28 Dec 2007 01:01:40 +0000</pubDate>
		<dc:creator>lizongbo</dc:creator>
				<category><![CDATA[JAVA IDE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Axis]]></category>
		<category><![CDATA[java ide]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://618119.com/archives/2007/12/28/54.html</guid>
		<description><![CDATA[前段时间给同事做了简单的WebService开发培训，效果不太理想。
因此把当时准备的资料备份一下，避免清理硬盘的时候弄没了。
带抓图的word文档在：http://618119.com/docs/WebService/Webservice_axis_dev.doc 
http://618119.com/docs/WebService/soaptest.html
下面是从word里保存出来的文字：
1 WebService 测试
不编写代码的情况下,对webservice进行测试,编写代码进行测试的方法.
1.1 使用xmlspy测试接口
测试webservice接口地址为:
http://www.webservicex.net/globalweather.asmx?WSDL
http://www.ayandy.com/Service.asmx?WSDL
http://www.ayandy.com/Service.asmx/getSupportProvince
http://www.ayandy.com/Service.asmx?op=getSupportCity
在xmlspy中的测试步骤:
1. 启动XmlSpy,主菜单&#8211;&#62;SOAP &#8211;&#62; Create new SOAP request.
2. 选择wsdl文件或者提供wsdl的网址:
3. 选择要测试的方法
4. 填写调用参数
5. 发送请求
6. 查看服务端返回的结果
7. 由于wsdl描述的webservice入口和我们要连接的服务器不一定是同一个地址,因此还可以改变连接参数
8. 因此
参考: http://www.altova.com/products/xmlspy/soap_test_debugger.html
这种方式的优点是：门槛低，只要会填参数就可以测试webservice。
缺点是：xmlspy不是免费的，xmlspy文件超大，携带不方便。无法查看http header.
1.2 用tcpmon测试捕获SOAP数据包
工具来源,下载地址:
http://apache.mirror.phpchina.com/ws/commons/tcpmon/1_0/tcpmon-1.0-bin.zip
优点，文件小巧，不只是测试webserice可以用，测试其它http接口也很方便。
缺点，没法设置contenttype，所以会有乱码。
1.3 用xmlhttp发送SOAP数据包
优点，简单的html可以存放在各地，可以在预先准备好SAOP数据的情况下，将该测试用例发给工程人员在现场进行测试。
缺点，soap数据要靠自己组装。
2 WebService开发
2.1 客户端代码开发
2.1.1 Wsdl2java命令方式
2.1.1.1 预备wsdl2java.bat
wsdl2java.bat的内容为：
%JAVA_HOME%/bin/java.exe -classpath &#8220;./axis-ant.jar;./axis.jar;./commons-discovery-0.2.jar;./commons-logging-1.0.4.jar;./jaxrpc.jar;./log4j-1.2.8.jar;./saaj.jar;./wsdl4j-1.5.1.jar&#8221;  org.apache.axis.wsdl.WSDL2Java  -v -n -O -1 -D -W -t -a -o E:\mywork\wsdl2javatest\src http://www.webservicex.net/globalweather.asmx?WSDL
(没有 –s –S两个选项, -s用来生成服务端代码，使用-s后， -t无效).
-o是原代码输出的地方。
2.1.1.2 在Jbuilder新建空白工程.
2.1.1.3 导入Axis和Junit的lib.
2.1.1.4 运行wsdl2java.bat
2.1.1.5 在Jbuilder中测试代码
2.1.1.6 以Ant方式运行WSDL2Java
wsdl2java.xml的配置为：
&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&#62;
&#60;project xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;
default=&#8221;buildclient&#8221; xsi:type=&#8221;project&#8221;&#62;
&#60;path id=&#8221;axis.classpath&#8221;&#62;
&#60;fileset dir=&#8221;./&#8221;&#62;
&#60;include [...]]]></description>
		<wfw:commentRss>http://618119.com/archives/2007/12/28/54.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
