| 1 |
<!-- =================================================================== |
|---|
| 2 |
Run wsimport on web service definitions. |
|---|
| 3 |
|
|---|
| 4 |
The jaxb released with java6 is version 2.1. However, to resolve some |
|---|
| 5 |
issues we have to use version 2.2. This requires either placing the |
|---|
| 6 |
jaxb jars in the endorsed directory or setting xendorsed="true" when |
|---|
| 7 |
running wsimport and adding the 2.2 jars to the classpath. |
|---|
| 8 |
|
|---|
| 9 |
The version of jboss in the quickstart has the 2.2 jars in its |
|---|
| 10 |
endorsed directory. For the moment we point at that. |
|---|
| 11 |
|
|---|
| 12 |
Hold that: Unfortunately eclipse doesn't appear to have a way to set |
|---|
| 13 |
an endorsed directory for a single project. The generated 2.2 classes |
|---|
| 14 |
don't compile. Managed to get 2.1 wsimport to run - the generated code |
|---|
| 15 |
appears to run OK on 2.2 |
|---|
| 16 |
|
|---|
| 17 |
@param wsdl Location of the wsdl |
|---|
| 18 |
@param sourcedestdir Location for the generated source |
|---|
| 19 |
|
|---|
| 20 |
Authors: Mike Douglass douglm rpi.edu |
|---|
| 21 |
=================================================================== --> |
|---|
| 22 |
|
|---|
| 23 |
<project name="do.wsimport" basedir="." default=""> |
|---|
| 24 |
<macrodef name="wsimport"> |
|---|
| 25 |
<attribute name="wsdl"/> |
|---|
| 26 |
<attribute name="sourcedestdir"/> |
|---|
| 27 |
<attribute name="bindingsdir" default="" /> |
|---|
| 28 |
<sequential> |
|---|
| 29 |
<taskdef resource="net/sf/antcontrib/antcontrib.properties" /> |
|---|
| 30 |
|
|---|
| 31 |
<!-- |
|---|
| 32 |
<getJar name="jaxws-tools" version="2.2" /> |
|---|
| 33 |
<getJar name="jaxb-xjc" version="2.2" /> |
|---|
| 34 |
<getJar name="jaxws-rt" version="2.2" /> |
|---|
| 35 |
--> |
|---|
| 36 |
<property name="wsimport.lib" |
|---|
| 37 |
location="${org.bedework.temp.dir}/wsimportlib" /> |
|---|
| 38 |
<delete dir="${wsimport.lib}" /> |
|---|
| 39 |
<mkdir dir="${wsimport.lib}" /> |
|---|
| 40 |
|
|---|
| 41 |
<getJar lib="${wsimport.lib}" |
|---|
| 42 |
libcache="${org.bedework.libcache.dir}" |
|---|
| 43 |
name="jaxws-tools" version="2.1.4" /> |
|---|
| 44 |
<getJar lib="${wsimport.lib}" |
|---|
| 45 |
libcache="${org.bedework.libcache.dir}" |
|---|
| 46 |
name="jaxb-xjc" version="2.1.7" /> |
|---|
| 47 |
<getJar lib="${wsimport.lib}" |
|---|
| 48 |
libcache="${org.bedework.libcache.dir}" |
|---|
| 49 |
name="jaxb-impl" version="2.1.8" /> |
|---|
| 50 |
<getJar lib="${wsimport.lib}" |
|---|
| 51 |
libcache="${org.bedework.libcache.dir}" |
|---|
| 52 |
name="jaxws-rt" version="2.1.4" /> |
|---|
| 53 |
<getJar lib="${wsimport.lib}" |
|---|
| 54 |
libcache="${org.bedework.libcache.dir}" |
|---|
| 55 |
name="streambuffer" version="1.0" /> |
|---|
| 56 |
<getJar lib="${wsimport.lib}" |
|---|
| 57 |
libcache="${org.bedework.libcache.dir}" |
|---|
| 58 |
name="stax-ex" version="2.2.1" /> |
|---|
| 59 |
|
|---|
| 60 |
<path id="wsimport.classpath"> |
|---|
| 61 |
<fileset dir="${ant.home}/lib"> |
|---|
| 62 |
<include name="jax*.jar"/> |
|---|
| 63 |
</fileset> |
|---|
| 64 |
<!-- |
|---|
| 65 |
<pathelement location="${wsimport.lib}/jaxws-tools-2.2.jar"/> |
|---|
| 66 |
<pathelement location="${wsimport.lib}/jaxb-xjc-2.2.jar"/> |
|---|
| 67 |
<pathelement location="${wsimport.lib}/jaxws-rt-2.2.jar"/> |
|---|
| 68 |
--> |
|---|
| 69 |
<pathelement location="${wsimport.lib}/jaxws-tools-2.1.4.jar"/> |
|---|
| 70 |
<pathelement location="${wsimport.lib}/jaxb-xjc-2.1.7.jar"/> |
|---|
| 71 |
<pathelement location="${wsimport.lib}/jaxb-impl-2.1.8.jar"/> |
|---|
| 72 |
<pathelement location="${wsimport.lib}/jaxws-rt-2.1.4.jar"/> |
|---|
| 73 |
<pathelement location="${wsimport.lib}/tools-1.6.0_21.jar" /> |
|---|
| 74 |
<pathelement location="${wsimport.lib}/streambuffer-1.0.jar" /> |
|---|
| 75 |
<pathelement location="${wsimport.lib}/stax-ex-2.2.1.jar" /> |
|---|
| 76 |
<fileset dir="${ant.home}/lib"> |
|---|
| 77 |
<include name="**/*.jar"/> |
|---|
| 78 |
</fileset> |
|---|
| 79 |
<!-- |
|---|
| 80 |
<fileset dir="${org.bedework.appserver.dir}/lib/endorsed" > |
|---|
| 81 |
<include name="**/*.jar"/> |
|---|
| 82 |
</fileset> |
|---|
| 83 |
--> |
|---|
| 84 |
</path> |
|---|
| 85 |
|
|---|
| 86 |
<debugCpid idpar="wsimport.classpath" /> |
|---|
| 87 |
|
|---|
| 88 |
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport"> |
|---|
| 89 |
<classpath refid="wsimport.classpath" /> |
|---|
| 90 |
</taskdef> |
|---|
| 91 |
|
|---|
| 92 |
<!-- We don't want the generated classes but there doesn't appear to be a |
|---|
| 93 |
way to suppress generation --> |
|---|
| 94 |
<property name="wsimport.dest" |
|---|
| 95 |
location="${org.bedework.temp.dir}/wsclasses" /> |
|---|
| 96 |
<mkdir dir="${wsimport.dest}" /> |
|---|
| 97 |
|
|---|
| 98 |
<if> |
|---|
| 99 |
<equals arg1="@{bindingsdir}" arg2="" /> |
|---|
| 100 |
<then> |
|---|
| 101 |
<wsimport keep="true" |
|---|
| 102 |
sourcedestdir="@{sourcedestdir}" |
|---|
| 103 |
destdir="${wsimport.dest}" |
|---|
| 104 |
wsdl="@{wsdl}" |
|---|
| 105 |
xendorsed="true" > |
|---|
| 106 |
</wsimport> |
|---|
| 107 |
</then> |
|---|
| 108 |
<else> |
|---|
| 109 |
<wsimport keep="true" |
|---|
| 110 |
sourcedestdir="@{sourcedestdir}" |
|---|
| 111 |
destdir="${wsimport.dest}" |
|---|
| 112 |
wsdl="@{wsdl}" |
|---|
| 113 |
xendorsed="true" > |
|---|
| 114 |
<binding dir="@{bindingsdir}" includes="*.xml"> |
|---|
| 115 |
</binding> |
|---|
| 116 |
</wsimport> |
|---|
| 117 |
</else> |
|---|
| 118 |
</if> |
|---|
| 119 |
</sequential> |
|---|
| 120 |
</macrodef> |
|---|
| 121 |
</project> |
|---|