用ant task 生成xfire 客户端代码

用xfire不管是配置web service,还是生成客户代码都很方便.
生成客户代码只要在用ant生成就可以了!

build.xml
<?xml version="1.0"?>

<project default="genfiles" basedir=".">
	<property name="lib" value="WebRoot/WEB-INF/lib" />
	<path id="myclasspath">
		<fileset dir="${lib}">
			<include name="*.jar" />
		</fileset>
		<pathelement location="${genfiles}" />
	</path>
	<property name="code_path" value="src" />
	<property name="wsdl_path" value="Echo1Service.xml" />
	<property name="code_package" value="com.client" />
	<target name="genfiles"  description="Generate the files">
		<taskdef name="wsgen" classname="org.codehaus.xfire.gen.WsGenTask" classpathref="myclasspath" />
		<wsgen outputDirectory="${code_path}" wsdl="${wsdl_path}" package="${code_package}" binding="xmlbeans" />
	</target>
</project>

你可能感兴趣的:(Web,xml,ant)