| 1 |
<html> |
| 2 |
<title>Axis Ant Tasks</title> |
| 3 |
<link href="../axis.css" rel=stylesheet type=text/css> |
| 4 |
<body> |
| 5 |
<h1>Axis Ant Tasks</h1> |
| 6 |
Axis comes with Ant tasks to automate aspects of the |
| 7 |
build process inside ant. To use these tasks, you need |
| 8 |
|
| 9 |
<ol> |
| 10 |
<li> |
| 11 |
<A href="http://jakarta.apache.org/ant">Apache Ant 1.5.1 or later</A> |
| 12 |
</li> |
| 13 |
<li> |
| 14 |
The library <tt>axis-ant.jar</tt> which contains the tasks |
| 15 |
</li> |
| 16 |
<li> |
| 17 |
All the main Axis libraries |
| 18 |
</li> |
| 19 |
</ol> |
| 20 |
<h3>Declaring the Tasks</h3> |
| 21 |
|
| 22 |
|
| 23 |
To declare the tasks, set up a classpath to include the axis task JAR and |
| 24 |
all the dependent libraries. Including everything in the axis lib directory |
| 25 |
should suffice |
| 26 |
<p> |
| 27 |
|
| 28 |
<pre><path id="axis.classpath"> |
| 29 |
<fileset dir="${axis.home}/build/lib"> |
| 30 |
<include name="**/*.jar" /> |
| 31 |
</fileset> |
| 32 |
</path> |
| 33 |
</pre> |
| 34 |
|
| 35 |
Then use the <tt><taskdef></tt> declaration to declare all the tasks listed |
| 36 |
in a properties file inside the <tt>axis-ant.jar</tt> file: |
| 37 |
<p> |
| 38 |
<pre><taskdef resource="axis-tasks.properties" |
| 39 |
classpathref="axis.classpath" /> |
| 40 |
</pre> |
| 41 |
|
| 42 |
<h3>Creating Java files from WSDL</h3> |
| 43 |
|
| 44 |
This uses the <a href="axis-wsdl2java.html"><axis-wsdl2java></a> task. |
| 45 |
<p> |
| 46 |
<pre><axis-wsdl2java |
| 47 |
output="${generated.dir}" |
| 48 |
testcase="true" |
| 49 |
verbose="true" |
| 50 |
url="${local.wsdl}" > |
| 51 |
<mapping |
| 52 |
namespace="http://axis.apache.org/ns/interop" |
| 53 |
package="interop" /> |
| 54 |
</axis-wsdl2java> |
| 55 |
</pre> |
| 56 |
|
| 57 |
The mapping elements are used to list the mappings from XML namespaces to |
| 58 |
Java packages; you can include as many as you need. |
| 59 |
|
| 60 |
<h3>Creating WSDL files from Java</h3> |
| 61 |
|
| 62 |
This uses the <a href="axis-java2wsdl.html"><axis-java2wsdl></a> task. |
| 63 |
|
| 64 |
|
| 65 |
<h3>Talking to the admin service</h3> |
| 66 |
|
| 67 |
This can be done with the |
| 68 |
<a href="axis-admin.html"><axis-admin></a> task. |
| 69 |
|
| 70 |
<p> |
| 71 |
<pre><axis-admin |
| 72 |
port="${target.port}" |
| 73 |
hostname="${target.server}" |
| 74 |
failonerror="true" |
| 75 |
servletpath="${target.appname}/services/AdminService" |
| 76 |
debug="true" |
| 77 |
xmlfile="${endpoint-stub.wsdd}" |
| 78 |
/> |
| 79 |
</pre> |
| 80 |
Here the target.* properties are pulled from a properties file for the |
| 81 |
system being deployed to, so a single build file can deploy to different |
| 82 |
systems with ease. |
| 83 |
</body> |
| 84 |
</html> |