Last active
March 16, 2022 18:38
-
-
Save rponte/850815 to your computer and use it in GitHub Desktop.
Generating webservice client stubs from WSDL with wsimport ant task (just a sample)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default.target.dir=build | |
ws.source.dir=ws-gen | |
ws.classes.dir=${default.target.dir}/ws-gen | |
jaxws.lib.dir=${lib.dir}/bundle/jaxws | |
ws.wsdl=http://localhost:8081/WebService/service?wsdl | |
#ws.wsdl=../wsdls/webservice-v1.0.22.wsdl | |
ws.gen.src.dir=gen-src | |
ws.gen.bin.dir=gen-bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<jaxb:bindings version="2.0" | |
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"> | |
<jaxb:globalBindings generateElementProperty="false"> | |
<jaxb:serializable uid="20130510160300" /> | |
</jaxb:globalBindings> | |
</jaxb:bindings> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding='UTF-8' ?> | |
<project name="WSClient-App" basedir="." default="all"> | |
<property file="build.properties" /> | |
<path id="jaxws-classpath"> | |
<fileset dir="${jaxws.lib.dir}"> | |
<include name="**/*.jar" /> | |
</fileset> | |
</path> | |
<target name="ws:import:taskdef"> | |
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport"> | |
<classpath> | |
<path refid="jaxws-classpath" /> | |
</classpath> | |
</taskdef> | |
</target> | |
<target name="ws:clean"> | |
<delete dir="${ws.gen.src.dir}" /> | |
<mkdir dir="${ws.gen.src.dir}"/> | |
<delete dir="${ws.gen.bin.dir}" /> | |
<mkdir dir="${ws.gen.bin.dir}"/> | |
</target> | |
<target name="ws:generate" depends="ws:import:taskdef, ws:clean"> | |
<wsimport | |
wsdl="${ws.wsdl}" | |
destdir="${ws.gen.bin.dir}" | |
sourcedestdir="${ws.gen.src.dir}" | |
verbose="true" | |
package="br.com.triadworks.ws"> | |
<!-- configuring jaxb bindings --> | |
<binding dir="${basedir}" | |
includes="javabindings.xml" /> | |
</wsimport> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment