Updated MTOM sample to use maven

This commit is contained in:
Arjen Poutsma
2010-02-26 10:20:20 +00:00
parent a434c97b94
commit 5b4bdbbafb
4 changed files with 68 additions and 168 deletions

View File

@@ -1,80 +0,0 @@
<?xml version="1.0"?>
<project name="spring-ws-airline-sample-jax-ws-client" default="build" xmlns:artifact="urn:maven-artifact-ant">
<property name="bin.dir" value="bin"/>
<property name="src.dir" value="src"/>
<property name="gen.dir" value="gen"/>
<property name="lib.dir" value="lib"/>
<target name="init">
<mkdir dir="${bin.dir}"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
<classpath>
<pathelement location="${basedir}/../../../maven-ant-tasks-2.0.7.jar"/>
</classpath>
</typedef>
<artifact:remoteRepository id="main" url="http://repo1.maven.org/maven2/"/>
<artifact:remoteRepository id="java.net" url="http://download.java.net/maven/1/"
layout="legacy"/>
<artifact:dependencies pathId="generate.classpath">
<remoteRepository refid="main"/>
<remoteRepository refid="java.net"/>
<dependency groupId="com.sun.xml.ws" artifactId="jaxws-tools" version="EA3"/>
<dependency groupId="com.sun.xml.bind" artifactId="jaxb-xjc" version="2.1-EA2"/>
<dependency groupId="com.sun.xml.stream.buffer" artifactId="streambuffer" version="0.3"/>
<dependency groupId="com.sun.xml.stream" artifactId="sjsxp" version="1.0"/>
<dependency groupId="org.jvnet.staxex" artifactId="stax-ex" version="1.0"/>
<dependency groupId="com.sun.xml.messaging.saaj" artifactId="saaj-impl" version="1.3"/>
</artifact:dependencies>
<artifact:dependencies pathId="compile.classpath">
<remoteRepository refid="main"/>
<remoteRepository refid="java.net"/>
<dependency groupId="javax.xml.ws" artifactId="jaxws-api" version="2.1-SNAPSHOT"/>
<dependency groupId="org.springframework" artifactId="spring-core" version="2.0.5"/>
</artifact:dependencies>
<artifact:dependencies pathId="runtime.classpath">
<remoteRepository refid="main"/>
<remoteRepository refid="java.net"/>
<dependency groupId="com.sun.xml.ws" artifactId="jaxws-rt" version="EA3"/>
<dependency groupId="com.sun.xml.bind" artifactId="jaxb-impl" version="2.1-EA2"/>
<dependency groupId="com.sun.xml.bind" artifactId="jaxb-xjc" version="2.1-EA2"/>
<dependency groupId="com.sun.xml.stream.buffer" artifactId="streambuffer" version="0.3"/>
<dependency groupId="com.sun.xml.stream" artifactId="sjsxp" version="1.0"/>
<dependency groupId="org.jvnet.staxex" artifactId="stax-ex" version="1.0"/>
<dependency groupId="com.sun.xml.messaging.saaj" artifactId="saaj-impl" version="1.3"/>
</artifact:dependencies>
</target>
<target name="generate" depends="init">
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport" classpathref="generate.classpath"/>
<wsimport wsdl="http://localhost:8080/mtom/mtom.wsdl" destdir="${bin.dir}"
package="org.springframework.ws.samples.mtom.client.jaxws">
<produces dir="${bin.dir}/org/springframework/ws/samples/mtom/client/jaxws" includes="**/*" />
</wsimport>
</target>
<target name="build" depends="generate">
<javac srcdir="${src.dir}" destdir="${bin.dir}" debug="true">
<classpath refid="compile.classpath"/>
<classpath location="${bin.dir}"/>
</javac>
</target>
<target name="clean">
<delete dir="${bin.dir}"/>
</target>
<target name="run" depends="build">
<java classname="org.springframework.ws.samples.mtom.client.jaxws.Main" fork="true" failonerror="true">
<jvmarg value="-Djava.awt.headless=true"/>
<arg path="../spring-ws-logo.png"/>
<classpath refid="compile.classpath"/>
<classpath refid="runtime.classpath"/>
<classpath location="${bin.dir}"/>
</java>
</target></project>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://www.springframework.org/spring-ws/samples/mtom" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.springframework.org/spring-ws/samples/mtom" targetNamespace="http://www.springframework.org/spring-ws/samples/mtom">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" elementFormDefault="qualified" targetNamespace="http://www.springframework.org/spring-ws/samples/mtom">
<element name="StoreImageRequest" type="tns:Image"/>
<element name="LoadImageRequest" type="string"/>
<element name="LoadImageResponse" type="tns:Image"/>
<complexType name="Image">
<sequence>
<element name="name" type="string"/>
<element name="image" type="base64Binary" xmime:expectedContentTypes="image/png"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="StoreImageRequest">
<wsdl:part element="tns:StoreImageRequest" name="StoreImageRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="LoadImageResponse">
<wsdl:part element="tns:LoadImageResponse" name="LoadImageResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="LoadImageRequest">
<wsdl:part element="tns:LoadImageRequest" name="LoadImageRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="ImageRepository">
<wsdl:operation name="StoreImage">
<wsdl:input message="tns:StoreImageRequest" name="StoreImageRequest">
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="LoadImage">
<wsdl:input message="tns:LoadImageRequest" name="LoadImageRequest">
</wsdl:input>
<wsdl:output message="tns:LoadImageResponse" name="LoadImageResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ImageRepositorySoap11" type="tns:ImageRepository">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="StoreImage">
<soap:operation soapAction=""/>
<wsdl:input name="StoreImageRequest">
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="LoadImage">
<soap:operation soapAction=""/>
<wsdl:input name="LoadImageRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="LoadImageResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ImageRepositoryService">
<wsdl:port binding="tns:ImageRepositorySoap11" name="ImageRepositorySoap11">
<soap:address location="http://localhost:8080/mtom-server/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@@ -37,7 +37,7 @@
</goals>
<configuration>
<wsdlUrls>
<wsdlUrl>http://localhost:8080/mtom-server/mtom.wsdl</wsdlUrl>
<wsdlUrl>file://${project.basedir}/mtom.wsdl</wsdlUrl>
</wsdlUrls>
<packageName>org.springframework.ws.samples.mtom.client.jaxws</packageName>
</configuration>

View File

@@ -1,87 +0,0 @@
<?xml version="1.0"?>
<project name="spring-ws-mtom-sample-sws-client" default="build" xmlns:artifact="urn:maven-artifact-ant">
<property name="bin.dir" value="bin"/>
<property name="src.dir" value="src"/>
<property name="gen.dir" value="gen"/>
<property name="lib.dir" value="lib"/>
<target name="init">
<mkdir dir="${bin.dir}"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
<classpath>
<pathelement location="${basedir}/../../../maven-ant-tasks-2.0.7.jar"/>
</classpath>
</typedef>
<artifact:remoteRepository id="main" url="http://repo1.maven.org/maven2/"/>
<artifact:remoteRepository id="java.net" url="http://download.java.net/maven/1/"
layout="legacy"/>
<artifact:dependencies pathId="generate.classpath">
<remoteRepository refid="main"/>
<remoteRepository refid="java.net"/>
<dependency groupId="com.sun.xml.ws" artifactId="jaxws-tools" version="EA3"/>
<dependency groupId="com.sun.xml.bind" artifactId="jaxb-xjc" version="2.1-EA2"/>
</artifact:dependencies>
<artifact:dependencies pathId="compile.classpath">
<remoteRepository refid="main"/>
<remoteRepository refid="java.net"/>
<dependency groupId="org.springframework" artifactId="spring-core" version="2.5.6"/>
<dependency groupId="org.springframework.ws" artifactId="spring-ws-core" version="2.0.0-M1"/>
<dependency groupId="org.apache.ws.commons.axiom" artifactId="axiom-api" version="1.2.8"/>
<dependency groupId="org.apache.ws.commons.axiom" artifactId="axiom-impl" version="1.2.8"/>
</artifact:dependencies>
<artifact:dependencies pathId="runtime.classpath">
<remoteRepository refid="main"/>
<remoteRepository refid="java.net"/>
<dependency groupId="org.springframework.ws" artifactId="spring-ws-core" version="2.0.0-M1"/>
<dependency groupId="org.springframework.ws" artifactId="spring-oxm" version="2.0.0-M1"/>
<dependency groupId="org.springframework.ws" artifactId="spring-oxm-tiger" version="2.0.0-M1"/>
<dependency groupId="com.sun.xml.ws" artifactId="jaxws-rt" version="EA3"/>
<dependency groupId="com.sun.xml.bind" artifactId="jaxb-impl" version="2.1-EA2"/>
<dependency groupId="com.sun.xml.messaging.saaj" artifactId="saaj-impl" version="1.3"/>
<dependency groupid="org.apache.ws.commons.axiom" artifactid="axiom-api" version="1.2.8"/>
<dependency groupid="org.apache.ws.commons.axiom" artifactid="axiom-impl" version="1.2.8"/>
</artifact:dependencies>
</target>
<target name="generate" depends="init">
<mkdir dir="${gen.dir}"/>
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="generate.classpath"/>
<xjc schema="../../src/main/webapp/WEB-INF/schema.xsd" destdir="${gen.dir}"
package="org.springframework.ws.samples.mtom.client.sws"/>
</target>
<target name="build" depends="init,generate">
<javac destdir="${bin.dir}" debug="true">
<src path="${src.dir}"/>
<src path="${gen.dir}"/>
<classpath refid="compile.classpath"/>
<classpath location="${bin.dir}"/>
</javac>
<copy todir="${bin.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}"/>
<delete dir="${gen.dir}"/>
</target>
<target name="run" depends="build">
<java classname="org.springframework.ws.samples.mtom.client.sws.Driver" fork="true" failonerror="true">
<jvmarg value="-Djava.awt.headless=true"/>
<arg path="../spring-ws-logo.png"/>
<classpath refid="compile.classpath"/>
<classpath refid="runtime.classpath"/>
<classpath location="${bin.dir}"/>
</java>
</target>
</project>