1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
<?xml version="1.0" encoding="UTF-8"?>
<project name="Session Beans as Web Services" default="deployejb" basedir=".">
<property environment="env"/>
<property name="deploy.dir" value="${env.JBOSS_DEPLOY}"/>
<property name="app.name" value="wsejbsample"/>
<property name="build.dir" value="build"/>
<property name="src.dir" value="src"/>
<property name="metainf.dir" value="META-INF"/>
<property name="axis.dir" location="../../"/>
<path id="classpath.id">
<fileset dir="${axis.dir}/build/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${deploy.dir}/../lib/jboss-j2ee.jar"/>
<pathelement location="${build.dir}"/>
</path>
<taskdef name="axis-java2wsdl" classname="org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask"
loaderref="axis" >
<classpath refid="classpath.id"/>
</taskdef>
<taskdef name="axis-admin" classname="org.apache.axis.tools.ant.axis.AdminClientTask"
loaderref="axis" >
<classpath refid="classpath.id"/>
</taskdef>
<taskdef name="axis-wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask"
loaderref="axis" >
<classpath refid="classpath.id"/>
</taskdef>
<target name="w2j-simplebean" depends="j2w-simplebean">
<axis-wsdl2java output="${build.dir}/java" testcase="true" url="./simplebean.wsdl">
<mapping namespace="http://localhost:8080/axis/services/SimpleBean" package="com.test.simplebean"/>
</axis-wsdl2java>
</target>
<target name="prepare">
<delete>
<fileset dir="${basedir}" includes="*jar"/>
</delete>
<mkdir dir="${build.dir}/java"/>
</target>
<target name="compile" depends="prepare">
<javac classpathref="classpath.id" srcdir="${src.dir}" destdir="${build.dir}"/>
</target>
<target name="build-client" depends="w2j-simplebean">
<javac classpathref="classpath.id" srcdir="${build.dir}/java" destdir="${build.dir}"/>
</target>
<target name="run-junit" depends="build-client, deployws">
<junit>
<classpath refid="classpath.id"/>
<formatter type="plain" usefile="false"/>
<test name="com.test.simplebean.SimpleBeanServiceTestCase"/>
</junit>
</target>
<target name="jar" depends="compile">
<jar destfile="${app.name}.jar">
<fileset dir="${build.dir}">
<include name="**/*.class" />
</fileset>
<metainf dir="${metainf.dir}"/>
</jar>
</target>
<target name="deployejb" depends="jar">
<copy file="${app.name}.jar" todir="${deploy.dir}"/>
</target>
<target name="deployws">
<axis-admin xmlfile="deploy.wsdd"/>
</target>
<target name="undeployws">
<axis-admin xmlfile="undeploy.wsdd"/>
</target>
<target name="j2w-simplebean">
<axis-java2wsdl classname="samples.ejb.SimpleBean" classpath="${build.dir}"
methods="sayHello"
output="simplebean.wsdl"
location="http://localhost:8080/axis/services/SimpleBean"
namespace="http://localhost:8080/axis/services/SimpleBean"
namespaceImpl="http://localhost:8080/axis/services/SimpleBean"/>
</target>
<target name="j2w-nicethingsbean">
<axis-java2wsdl classname="samples.ejb.NiceThingsBean"
methods="sayHello,findNiceThingsFor,updateNiceThingsFor"
output="nicethings.wsdl"
location="http://localhost:8080/axis/services/NiceThingsBean"
namespace="http://localhost:8080/axis/services/NiceThingsBean"
namespaceImpl=
"http://localhost:8080/axis/services/NiceThingsBean">
<complextype classname="samples.ejb.NiceThings"
namespace="urn:NiceThingsBean"/>
<!-- You can also pass in another serializer/deserializer if you don't want to use the default
BeanSerializerFactory for a particular complextype
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" -->
</axis-java2wsdl>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
</project>
|