Upgraded POX sample to use maven

This commit is contained in:
Arjen Poutsma
2010-02-26 10:43:31 +00:00
parent b71416c539
commit 9154bbf4d3
18 changed files with 83 additions and 80 deletions

View File

@@ -1,2 +0,0 @@
#!/bin/sh
curl --header "Content-type: application/xml" -v --data @contactsRequest.xml http://localhost:8080/pox/

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>pox</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.0.0-M1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pox-client</artifactId>
<packaging>pom</packaging>
<name>Spring WS POX Sample - Clients</name>
<modules>
<module>spring-ws</module>
</modules>
</project>

View File

@@ -1,45 +0,0 @@
<?xml version="1.0"?>
<project name="spring-ws-pox-sample-spring-ws-client" default="build" xmlns:artifact="urn:maven-artifact-ant">
<property name="bin.dir" value="bin"/>
<property name="src.dir" value="src"/>
<target name="init">
<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:dependencies pathId="classpath">
<dependency groupId="org.springframework.ws" artifactId="spring-ws-core" version="2.0.0-M1"/>
<dependency groupId="log4j" artifactId="log4j" version="1.2.13"/>
</artifact:dependencies>
</target>
<target name="build" depends="init">
<mkdir dir="${bin.dir}"/>
<javac srcdir="${src.dir}" destdir="${bin.dir}">
<classpath refid="classpath"/>
</javac>
<copy todir="${bin.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}"/>
</target>
<target name="run" depends="contacts"/>
<target name="contacts" depends="build">
<java classname="org.springframework.ws.samples.pox.client.sws.ContactsClient" fork="true" failonerror="true">
<classpath refid="classpath"/>
<classpath location="${bin.dir}"/>
</java>
</target>
</project>

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>pox-client</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.0.0-M1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pox-spring-ws-client</artifactId>
<packaging>jar</packaging>
<name>Spring WS POX Sample - Spring-WS Client</name>
<profiles>
<profile>
<id>jdk15</id>
<activation>
<jdk>!1.6</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.springframework.ws.samples.pox.client.sws.ContactsClient</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-xml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -52,7 +52,9 @@ public class ContactsClient extends WebServiceGatewaySupport {
DOMResult result = new DOMResult();
getWebServiceTemplate().sendSourceAndReceiveToResult(requestSource, result);
int contactCount = (int) expression.evaluateAsNumber(result.getNode());
System.out.println();
System.out.println("contactCount = " + contactCount);
System.out.println();
}
public static void main(String[] args) throws IOException {

View File

@@ -4,7 +4,7 @@
<bean id="contactsClient" class="org.springframework.ws.samples.pox.client.sws.ContactsClient">
<constructor-arg ref="messageFactory"/>
<property name="defaultUri" value="http://localhost:8080/pox/"/>
<property name="defaultUri" value="http://localhost:8080/pox-server/"/>
<property name="request" value="classpath:org/springframework/ws/samples/pox/client/sws/contactsRequest.xml"/>
<property name="expression" ref="expression"/>
</bean>

View File

@@ -1,14 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>spring-ws-samples</artifactId>
<artifactId>pox</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.0.0-M1-SNAPSHOT</version>
<relativePath>../samples/pom.xml</relativePath>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pox</artifactId>
<artifactId>pox-server</artifactId>
<packaging>war</packaging>
<name>Spring WS POX Sample</name>
<name>Spring WS POX Sample - Server</name>
<description>A Spring-WS sample that uses Plain Old XML, rather than SOAP.</description>
<profiles>
<profile>
@@ -24,28 +24,11 @@
</dependencies>
</profile>
</profiles>
<reporting>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<stylesheetfile>${basedir}/../../src/main/javadoc/javadoc.css</stylesheetfile>
</configuration>
</plugin>
</plugins>
</reporting>
<dependencies>
<!-- Spring-WS dependencies -->
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>easymock</groupId>
<artifactId>easymock</artifactId>
<version>1.2_Java1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Contacts xmlns="http://www.springframework.org/spring-ws/samples/pox">
<Contact>
<Name>John Doe</Name>
<Phone>626-555-3456</Phone>
</Contact>
<Contact>
<Name>Jane Doe</Name>
<Phone>626-555-6543</Phone>
</Contact>
</Contacts>