From 3090298704a73b56b756ea188688130dda4d2565 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Thu, 16 Sep 2010 19:02:35 -0400 Subject: [PATCH] INT-1380 added ws-outbound-gateway sample --- .../samples/ws/InContainerTests.java | 4 +- .../ws-outbound-gateway/.classpath | 3 + .../ws-outbound-gateway/.gitignore | 1 + getting-started/ws-outbound-gateway/pom.xml | 82 +++++++++++------- .../ws-outbound-gateway/readme.txt | 15 ++++ .../java => src.test/resources}/log4j.xml | 0 .../integration}/temperatureConversion.xml | 0 .../samples/ws/WebServiceDemoTest.java} | 12 +-- .../target/classes/log4j.xml | 36 -------- .../samples/ws/WebServiceDemo.class | Bin 1969 -> 0 bytes .../samples/ws/temperatureConversion.xml | 29 ------- .../target/maven-archiver/pom.properties | 5 -- ...-outbound-gateway-2.0.0.BUILD-SNAPSHOT.jar | Bin 4936 -> 0 bytes 13 files changed, 78 insertions(+), 109 deletions(-) create mode 100644 getting-started/ws-outbound-gateway/.gitignore create mode 100644 getting-started/ws-outbound-gateway/readme.txt rename getting-started/ws-outbound-gateway/{src/main/java => src.test/resources}/log4j.xml (100%) rename getting-started/ws-outbound-gateway/src/main/{java/org/springframework/integration/samples/ws => reources/META-INF/spring/integration}/temperatureConversion.xml (100%) rename getting-started/ws-outbound-gateway/src/{main/java/org/springframework/integration/samples/ws/WebServiceDemo.java => test/java/rg/springframework/integration/samples/ws/WebServiceDemoTest.java} (85%) delete mode 100644 getting-started/ws-outbound-gateway/target/classes/log4j.xml delete mode 100644 getting-started/ws-outbound-gateway/target/classes/org/springframework/integration/samples/ws/WebServiceDemo.class delete mode 100644 getting-started/ws-outbound-gateway/target/classes/org/springframework/integration/samples/ws/temperatureConversion.xml delete mode 100644 getting-started/ws-outbound-gateway/target/maven-archiver/pom.properties delete mode 100644 getting-started/ws-outbound-gateway/target/ws-outbound-gateway-2.0.0.BUILD-SNAPSHOT.jar 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 b05c0328cbf1e32a7c47fe436aeb164f3b579219..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1969 zcmbVNTUS#@6#gb8CWf?N5QJV7@RktFP^`3&5QQiYu81yip|($xFeFFMturSeKdUdL z*0s9&+#l7|Jvk?u$XSBsVNPbx?7hGJ?aTc8-(PXi5Zo4Sn?G*8lC6N@T-9=| zpvEv#DDE;O>)xKsVg%=NNZ}mASi^GVcGqc2^-MHv$&hb&En)8pWtn{>Oa>iGGgKO1 z46s7Z9bvf)Q-xm}AAs%zCfZ7IH;oGnn{oDA9x?DH;JWMko(g!~7Fs_MLFa{IZ}`4# zwR+^#!)qB#Fw6wf@gE{Km1f7{{auev08n;Utg&NzYFY*)+q$IAlYq ziO{t=!gZz1H>Gg5L@V&rQ9TqrmD;ljN*0&!je+nj!*U^((k3Zuz8|U&nj$zEe9zFS zZi$YPZbw?dGp{afZFTi5#pmkv`A!h{Yn&Sny2>gW3aWDma z&WgW~mQZaP3KKEy%#e<{mLiOe=JT4GrpH)BZoi8dHewAAqU}$NNR>x?^-Yk~tdhTV zr4DG6n9+A)E>R#(Sk4S*uP76K*z*iar=lEA34xj#9>GU`e+;jm)mHUnBsCN5j@MN! zxn-F_KQa7*luhiI13eY=A^{2dM^6N;Y1(o6GWw<#j*#0$GF&dhf6O@$C!DP|8D!%pSb)7uB{~(^M$uqNMJ2B zlbT7s#Zm&#jkggPZ}Z5|dW}3>$0Uk0Mhlpx-kPKGFVQ1<2e*4jYN0o*;3vAD!vcQB vDq)$Vn`@|0Xw$fiD%Q#F97$`qO9)G(dk-5F^kz?sMQ3$7qbep@0uTNNoFGyi 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 eb98e4409091a572bd916b88e792ce0adb4b34c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4936 zcmb_f2|Sc*7avbidp8yU+aI_kHH~KIebV^PcmZbN-fQZ0uYh=IDXT z=>9(W?PspQ`{6J??ru0|EIQB^=k+%d65o-)_z=+UIA;RJ*XM7f z75;%V-WluXjmG~Ciqa3D1g-;Z`Q6L>wnwhJvw%S1Y#BH3q)UW?!ndiT9--kn)3O{ez3;ENfj9TcnYtlC<0V?4;I z+Y;n2(43G|F8yX%$sm)2hZ&+Jcd*v*eu92QJ|`Aaed-eBXDt>M47`a z4Y2emtA+Cy4rK`!vj6otFZ`)Z;T(=WXwa31-e@y&g^cDf`U}y}0Golc=6riyb*$`CcI(OtpPo?ob8lSDYmuUoCj2fupB@$!u%k`o$aF%J%F~ zR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