diff --git a/getting-started/ws-inbound-gateway/src/test/java/org/springframework/integration/samples/ws/InContainerTests.java b/getting-started/ws-inbound-gateway/src/test/java/org/springframework/integration/samples/ws/InContainerTests.java index cd7cc918..3fcb01b6 100644 --- a/getting-started/ws-inbound-gateway/src/test/java/org/springframework/integration/samples/ws/InContainerTests.java +++ b/getting-started/ws-inbound-gateway/src/test/java/org/springframework/integration/samples/ws/InContainerTests.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertThat; import javax.xml.transform.Source; +import org.apache.log4j.Logger; import org.junit.Test; import org.springframework.ws.client.core.WebServiceTemplate; @@ -38,6 +39,7 @@ import org.springframework.xml.transform.StringSource; */ public class InContainerTests { + private static Logger logger = Logger.getLogger(InContainerTests.class); private static final String WS_URI = "http://localhost:8080/ws-inbound-gateway/echoservice"; private final WebServiceTemplate template = new WebServiceTemplate(); @@ -49,7 +51,7 @@ public class InContainerTests { "hello"); template.sendSourceAndReceiveToResult(WS_URI, payload, result); - System.out.println("RESULT: " + result.toString()); + logger.info("RESULT: " + result.toString()); assertThat(result.toString(), equalTo( "" + "hello")); diff --git a/getting-started/ws-outbound-gateway/.classpath b/getting-started/ws-outbound-gateway/.classpath index 24166ba5..293d7a71 100644 --- a/getting-started/ws-outbound-gateway/.classpath +++ b/getting-started/ws-outbound-gateway/.classpath @@ -1,6 +1,9 @@ + + + diff --git a/getting-started/ws-outbound-gateway/.gitignore b/getting-started/ws-outbound-gateway/.gitignore new file mode 100644 index 00000000..ea8c4bf7 --- /dev/null +++ b/getting-started/ws-outbound-gateway/.gitignore @@ -0,0 +1 @@ +/target diff --git a/getting-started/ws-outbound-gateway/pom.xml b/getting-started/ws-outbound-gateway/pom.xml index f3b0d177..d9b040c9 100644 --- a/getting-started/ws-outbound-gateway/pom.xml +++ b/getting-started/ws-outbound-gateway/pom.xml @@ -2,48 +2,64 @@ 4.0.0 - - org.springframework.integration.samples - spring-integration-samples - 2.0.0.BUILD-SNAPSHOT - + org.springframework.integration.samples ws-outbound-gateway Spring Integration WS Outbound Gateway Sample + 2.0.0 + jar + + 2.0.0.M7 + 1.2.15 + 4.7 + 1.3 + 1.1.1 + - - com.sun.xml.messaging.saaj - saaj-impl - 1.3 - - - javax.activation - activation - 1.1.1 - org.springframework.integration spring-integration-stream + ${spring.integration.version} org.springframework.integration spring-integration-ws + ${spring.integration.version} + + + com.sun.xml.messaging.saaj + saaj-impl + ${saaj.version} + + + javax.activation + activation + ${javax-activation.version} + + + log4j + log4j + ${log4j.version} + + + + junit + junit + ${junit.version} - - - repository.springframework.maven.release - Spring Framework Maven Release Repository - http://maven.springframework.org/release - - - repository.springframework.maven.milestone - Spring Framework Maven Milestone Repository - http://maven.springframework.org/milestone - - - repository.springframework.maven.snapshot - Spring Framework Maven Snapshot Repository - http://maven.springframework.org/snapshot - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + -Xlint:all + true + false + + + + + \ No newline at end of file diff --git a/getting-started/ws-outbound-gateway/readme.txt b/getting-started/ws-outbound-gateway/readme.txt new file mode 100644 index 00000000..6397e403 --- /dev/null +++ b/getting-started/ws-outbound-gateway/readme.txt @@ -0,0 +1,15 @@ +This example demonstrates the following aspects of the WS support available with Spring Integration: +1. WS Outbound Gateway + +as well as: +2. Content Enricher +3. Composed Message Processor + +A very simple example that show you how easy it is to invoke a SOAP based service using Spring Integration + +Message is simply sent to a channel where it is retrieved by a Chain which consists of Header Enricher and WS Outbound Gateway +Header Enricher enriches Message with the SOAP action header +WS Outbound Gateway converts Message to a SOAP request and sends it to a remote service which converts temperature from +Fahrenheit to Celsius and sent back where the result is printed to a console. + +To run sample simply execute WebServicesDemoTest diff --git a/getting-started/ws-outbound-gateway/src/main/java/log4j.xml b/getting-started/ws-outbound-gateway/src.test/resources/log4j.xml similarity index 100% rename from getting-started/ws-outbound-gateway/src/main/java/log4j.xml rename to getting-started/ws-outbound-gateway/src.test/resources/log4j.xml diff --git a/getting-started/ws-outbound-gateway/src/main/java/org/springframework/integration/samples/ws/temperatureConversion.xml b/getting-started/ws-outbound-gateway/src/main/reources/META-INF/spring/integration/temperatureConversion.xml similarity index 100% rename from getting-started/ws-outbound-gateway/src/main/java/org/springframework/integration/samples/ws/temperatureConversion.xml rename to getting-started/ws-outbound-gateway/src/main/reources/META-INF/spring/integration/temperatureConversion.xml diff --git a/getting-started/ws-outbound-gateway/src/main/java/org/springframework/integration/samples/ws/WebServiceDemo.java b/getting-started/ws-outbound-gateway/src/test/java/rg/springframework/integration/samples/ws/WebServiceDemoTest.java similarity index 85% rename from getting-started/ws-outbound-gateway/src/main/java/org/springframework/integration/samples/ws/WebServiceDemo.java rename to getting-started/ws-outbound-gateway/src/test/java/rg/springframework/integration/samples/ws/WebServiceDemoTest.java index 93bb6654..a1d371ab 100644 --- a/getting-started/ws-outbound-gateway/src/main/java/org/springframework/integration/samples/ws/WebServiceDemo.java +++ b/getting-started/ws-outbound-gateway/src/test/java/rg/springframework/integration/samples/ws/WebServiceDemoTest.java @@ -14,8 +14,9 @@ * limitations under the License. */ -package org.springframework.integration.samples.ws; +package rg.springframework.integration.samples.ws; +import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.Message; import org.springframework.integration.MessageChannel; @@ -30,10 +31,12 @@ import org.springframework.integration.support.channel.ChannelResolver; * * @author Marius Bogoevici */ -public class WebServiceDemo { +public class WebServiceDemoTest { - public static void main(String[] args) { - ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("temperatureConversion.xml", WebServiceDemo.class); + @Test + public void testWsOutboundGateway() { + ClassPathXmlApplicationContext context = + new ClassPathXmlApplicationContext("/META-INF/spring/integration/temperatureConversion.xml", WebServiceDemoTest.class); ChannelResolver channelResolver = new BeanFactoryChannelResolver(context); // Compose the XML message according to the server's schema @@ -49,5 +52,4 @@ public class WebServiceDemo { MessageChannel channel = channelResolver.resolveChannelName("fahrenheitChannel"); channel.send(message); } - } diff --git a/getting-started/ws-outbound-gateway/target/classes/log4j.xml b/getting-started/ws-outbound-gateway/target/classes/log4j.xml deleted file mode 100644 index 6cb1544e..00000000 --- a/getting-started/ws-outbound-gateway/target/classes/log4j.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/getting-started/ws-outbound-gateway/target/classes/org/springframework/integration/samples/ws/WebServiceDemo.class b/getting-started/ws-outbound-gateway/target/classes/org/springframework/integration/samples/ws/WebServiceDemo.class deleted file mode 100644 index b05c0328..00000000 Binary files a/getting-started/ws-outbound-gateway/target/classes/org/springframework/integration/samples/ws/WebServiceDemo.class and /dev/null differ diff --git a/getting-started/ws-outbound-gateway/target/classes/org/springframework/integration/samples/ws/temperatureConversion.xml b/getting-started/ws-outbound-gateway/target/classes/org/springframework/integration/samples/ws/temperatureConversion.xml deleted file mode 100644 index e6a3c495..00000000 --- a/getting-started/ws-outbound-gateway/target/classes/org/springframework/integration/samples/ws/temperatureConversion.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/getting-started/ws-outbound-gateway/target/maven-archiver/pom.properties b/getting-started/ws-outbound-gateway/target/maven-archiver/pom.properties deleted file mode 100644 index 6d09df5a..00000000 --- a/getting-started/ws-outbound-gateway/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Sat Sep 04 08:22:37 EDT 2010 -version=2.0.0.BUILD-SNAPSHOT -groupId=org.springframework.integration.samples -artifactId=ws-outbound-gateway diff --git a/getting-started/ws-outbound-gateway/target/ws-outbound-gateway-2.0.0.BUILD-SNAPSHOT.jar b/getting-started/ws-outbound-gateway/target/ws-outbound-gateway-2.0.0.BUILD-SNAPSHOT.jar deleted file mode 100644 index eb98e440..00000000 Binary files a/getting-started/ws-outbound-gateway/target/ws-outbound-gateway-2.0.0.BUILD-SNAPSHOT.jar and /dev/null differ