| Apache | Web Services | Axis |
Axis Ant TasksAxis comes with Ant tasks to automate aspects of the build process inside ant. To use these tasks, you need
Declaring the TasksTo declare the tasks, set up a classpath to include the axis task JAR and all the dependent libraries. Including everything in the axis lib directory should suffice <path id="axis.classpath">
<fileset dir="${axis.home}/build/lib">
<include name="**/*.jar" />
</fileset>
</path>
Then use the <taskdef> declaration to declare all the tasks listed in a properties file inside the axis-ant.jar file: <taskdef resource="axis-tasks.properties" classpathref="axis.classpath" /> Creating Java files from WSDLThis uses the <axis-wsdl2java> task. <axis-wsdl2java
output="${generated.dir}"
testcase="true"
verbose="true"
url="${local.wsdl}" >
<mapping
namespace="http://axis.apache.org/ns/interop"
package="interop" />
</axis-wsdl2java>
The mapping elements are used to list the mappings from XML namespaces to Java packages; you can include as many as you need. Creating WSDL files from JavaThis uses the <axis-java2wsdl> task. Talking to the admin serviceThis can be done with the <axis-admin> task. <axis-admin
port="${target.port}"
hostname="${target.server}"
failonerror="true"
servletpath="${target.appname}/services/AdminService"
debug="true"
xmlfile="${endpoint-stub.wsdd}"
/>
Here the target.* properties are pulled from a properties file for the system being deployed to, so a single build file can deploy to different systems with ease. Foreach TaskRunaxisfunctionaltests Task |