diff --git a/samples/stockquote/client/jax-ws/pom.xml b/samples/stockquote/client/jax-ws/pom.xml new file mode 100644 index 00000000..841921ad --- /dev/null +++ b/samples/stockquote/client/jax-ws/pom.xml @@ -0,0 +1,63 @@ + + + + stockquote-client + org.springframework.ws + 2.0.0-M1-SNAPSHOT + ../pom.xml + + 4.0.0 + stockquote-jax-ws-client + jar + Spring WS Stock Quote Sample - JAX-WS Client + + + jdk15 + + !1.6 + + + + javax.xml.soap + saaj-api + compile + + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + + + + wsimport + + + + file://${project.basedir}/../../server//src/main/resources/org/springframework/ws/samples/stockquote/ws/stockquote.wsdl + + org.springframework.ws.samples.stockquote.client.jaxws + + + + + + org.codehaus.mojo + exec-maven-plugin + + + + java + + + + + org.springframework.ws.samples.stockquote.client.jaxws.Main + + + + + diff --git a/samples/stockquote/client/jax-ws/readme.txt b/samples/stockquote/client/jax-ws/readme.txt deleted file mode 100644 index f78313bd..00000000 --- a/samples/stockquote/client/jax-ws/readme.txt +++ /dev/null @@ -1,11 +0,0 @@ -SPRING WEB SERVICES - -This directory contains a Java client for the Stock Quote Web Service that uses JAX-WS. -The client can be run from the provided ant file, by calling "ant run". -Note that the stock quote sample has to be running before invoking this target. - -Client Sample table of contents ---------------------------------------------------- -* src - The source files for the client -* build.xml - Ant build file with a 'build' and a 'run' target - diff --git a/samples/stockquote/client/jax-ws/src/org/springframework/ws/samples/stockquote/client/jaxws/Main.java b/samples/stockquote/client/jax-ws/src/main/java/org/springframework/ws/samples/stockquote/client/jaxws/Main.java similarity index 100% rename from samples/stockquote/client/jax-ws/src/org/springframework/ws/samples/stockquote/client/jaxws/Main.java rename to samples/stockquote/client/jax-ws/src/main/java/org/springframework/ws/samples/stockquote/client/jaxws/Main.java diff --git a/samples/stockquote/client/pom.xml b/samples/stockquote/client/pom.xml new file mode 100644 index 00000000..91030849 --- /dev/null +++ b/samples/stockquote/client/pom.xml @@ -0,0 +1,17 @@ + + + + stockquote + org.springframework.ws + 2.0.0-M1-SNAPSHOT + ../pom.xml + + 4.0.0 + stockquote-client + pom + Spring WS Stock Quote Sample - Clients + + jax-ws + spring-ws + + diff --git a/samples/stockquote/client/spring-ws/pom.xml b/samples/stockquote/client/spring-ws/pom.xml new file mode 100644 index 00000000..0305aa3e --- /dev/null +++ b/samples/stockquote/client/spring-ws/pom.xml @@ -0,0 +1,60 @@ + + + + stockquote-client + org.springframework.ws + 2.0.0-M1-SNAPSHOT + ../pom.xml + + 4.0.0 + stockquote-spring-ws-client + jar + Spring WS Stock Quote Sample - Spring-WS Client + + + jdk15 + + !1.6 + + + + javax.xml.soap + saaj-api + runtime + + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + + java + + + + + org.springframework.ws.samples.stockquote.client.sws.StockClient + + + + + + + org.springframework + spring-context + + + org.springframework.ws + spring-xml + + + org.springframework.ws + spring-ws-core + + + diff --git a/samples/stockquote/client/spring-ws/src/org/springframework/ws/samples/stockquote/client/sws/StockClient.java b/samples/stockquote/client/spring-ws/src/main/java/org/springframework/ws/samples/stockquote/client/sws/StockClient.java similarity index 97% rename from samples/stockquote/client/spring-ws/src/org/springframework/ws/samples/stockquote/client/sws/StockClient.java rename to samples/stockquote/client/spring-ws/src/main/java/org/springframework/ws/samples/stockquote/client/sws/StockClient.java index 5b67d6af..1f05c2bd 100644 --- a/samples/stockquote/client/spring-ws/src/org/springframework/ws/samples/stockquote/client/sws/StockClient.java +++ b/samples/stockquote/client/spring-ws/src/main/java/org/springframework/ws/samples/stockquote/client/sws/StockClient.java @@ -46,7 +46,9 @@ public class StockClient extends WebServiceGatewaySupport { Source requestSource = new ResourceSource(request); StringResult result = new StringResult(); getWebServiceTemplate().sendSourceAndReceiveToResult(requestSource, new ActionCallback(action), result); + System.out.println(); System.out.println(result); + System.out.println(); } public static void main(String[] args) throws IOException { diff --git a/samples/stockquote/client/spring-ws/src/log4j.properties b/samples/stockquote/client/spring-ws/src/main/resources/log4j.properties similarity index 100% rename from samples/stockquote/client/spring-ws/src/log4j.properties rename to samples/stockquote/client/spring-ws/src/main/resources/log4j.properties diff --git a/samples/stockquote/client/spring-ws/src/org/springframework/ws/samples/stockquote/client/sws/applicationContext.xml b/samples/stockquote/client/spring-ws/src/main/resources/org/springframework/ws/samples/stockquote/client/sws/applicationContext.xml similarity index 100% rename from samples/stockquote/client/spring-ws/src/org/springframework/ws/samples/stockquote/client/sws/applicationContext.xml rename to samples/stockquote/client/spring-ws/src/main/resources/org/springframework/ws/samples/stockquote/client/sws/applicationContext.xml diff --git a/samples/stockquote/client/spring-ws/src/org/springframework/ws/samples/stockquote/client/sws/quotesRequest.xml b/samples/stockquote/client/spring-ws/src/main/resources/org/springframework/ws/samples/stockquote/client/sws/quotesRequest.xml similarity index 100% rename from samples/stockquote/client/spring-ws/src/org/springframework/ws/samples/stockquote/client/sws/quotesRequest.xml rename to samples/stockquote/client/spring-ws/src/main/resources/org/springframework/ws/samples/stockquote/client/sws/quotesRequest.xml diff --git a/samples/stockquote/client/wcf/bin/client.exe b/samples/stockquote/client/wcf/bin/client.exe deleted file mode 100644 index 76789724..00000000 Binary files a/samples/stockquote/client/wcf/bin/client.exe and /dev/null differ diff --git a/samples/stockquote/client/wcf/bin/client.exe.config b/samples/stockquote/client/wcf/bin/client.exe.config deleted file mode 100644 index 75a57f8f..00000000 --- a/samples/stockquote/client/wcf/bin/client.exe.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/stockquote/client/wcf/build.bat b/samples/stockquote/client/wcf/build.bat deleted file mode 100644 index 5af9f17e..00000000 --- a/samples/stockquote/client/wcf/build.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -set WCF_PATH=%WINDIR%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation -svcutil /noLogo /out:src\StockService.cs -namespace:http://www.springframework.org/spring-ws/samples/stockquote,Spring.Ws.Samples.Stock.Client.Wcf /noConfig http://localhost:8080/StockService.wsdl -csc /noLogo /out:bin\client.exe src\Main.cs src\StockService.cs -copy src\*.config bin\ \ No newline at end of file diff --git a/samples/stockquote/client/wcf/readme.txt b/samples/stockquote/client/wcf/readme.txt deleted file mode 100644 index 35a2b9a0..00000000 --- a/samples/stockquote/client/wcf/readme.txt +++ /dev/null @@ -1,12 +0,0 @@ -SPRING WEB SERVICES - -This directory contains a C# client for the Stock Quote Web Service that uses -Windows Communication Foundation. The client can be built using the specific -build file, which requires WCF (.NET 3.0) on the patch. Note that the stock -quote sample has to be running before invoking this target. - -Client Sample table of contents ---------------------------------------------------- -* src - The source files for the client -* build.bat - Build bactch file - diff --git a/samples/stockquote/client/wcf/src/Main.cs b/samples/stockquote/client/wcf/src/Main.cs deleted file mode 100644 index 8476d7db..00000000 --- a/samples/stockquote/client/wcf/src/Main.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.IO; -using System.ServiceModel; - -namespace Spring.Ws.Samples.Stock.Client.Wcf -{ - - public class Client - { - public static void Main(string[] args) - { - StockClient wcfClient = new StockClient(); - try - { - string[] symbols = new string[] { "FABRIKAM", "CONTOSO" }; - StockQuoteRequest request = new StockQuoteRequest(symbols); - - Console.Out.WriteLine("Requesting quotes for {0}", symbols); - StockQuote[] quotes = wcfClient.StockQuote(symbols); - - Console.Out.WriteLine("Got {0} results", quotes.Length); - - foreach (StockQuote quote in quotes) - { - Console.Out.WriteLine(); - Console.Out.WriteLine("Symbol: " + quote.Symbol); - Console.Out.WriteLine("\tName:\t\t\t" + quote.Name); - Console.Out.WriteLine("\tLast Price:\t\t" + quote.Last); - Console.Out.WriteLine("\tPrevious Change:\t" + quote.Change + "%"); - } - - } - catch (TimeoutException ex) - { - Console.Error.WriteLine("The service operation timed out. " + ex.Message); - wcfClient.Abort(); - } - catch (FaultException ex) - { - Console.Error.WriteLine("SOAP Fault Code {0}", ex.Code); - Console.Error.WriteLine("SOAP Fault Reason: {0}", ex.Reason); - wcfClient.Abort(); - } - catch (CommunicationException ex) - { - Console.WriteLine(ex.GetType()); - Console.Error.WriteLine("There was a communication problem. " + ex.Message); - Console.Error.WriteLine(ex.StackTrace); - wcfClient.Abort(); - } - catch (Exception ex) - { - Console.Error.WriteLine("Unknown exception. " + ex.Message); - Console.Error.WriteLine(ex.StackTrace); - wcfClient.Abort(); - } - } - } -} diff --git a/samples/stockquote/client/wcf/src/StockService.cs b/samples/stockquote/client/wcf/src/StockService.cs deleted file mode 100644 index c95e4ade..00000000 --- a/samples/stockquote/client/wcf/src/StockService.cs +++ /dev/null @@ -1,207 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.1433 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - - - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.648")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.springframework.org/spring-ws/samples/stockquote")] -public partial class StockQuote -{ - - private string symbolField; - - private double lastField; - - private System.DateTime dateField; - - private double changeField; - - private string nameField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Order=0)] - public string Symbol - { - get - { - return this.symbolField; - } - set - { - this.symbolField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Order=1)] - public double Last - { - get - { - return this.lastField; - } - set - { - this.lastField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Order=2)] - public System.DateTime Date - { - get - { - return this.dateField; - } - set - { - this.dateField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Order=3)] - public double Change - { - get - { - return this.changeField; - } - set - { - this.changeField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute(Order=4)] - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameField = value; - } - } -} -namespace Spring.Ws.Samples.Stock.Client.Wcf -{ - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] - [System.ServiceModel.ServiceContractAttribute(Namespace="http://www.springframework.org/spring-ws/samples/stockquote", ConfigurationName="Spring.Ws.Samples.Stock.Client.Wcf.Stock")] - public interface Stock - { - - // CODEGEN: Generating message contract since the operation StockQuote is neither RPC nor document wrapped. - [System.ServiceModel.OperationContractAttribute(Action="http://www.springframework.org/spring-ws/samples/stockquote/StockService/GetQuote" + - "", ReplyAction="http://www.springframework.org/spring-ws/samples/stockquote/StockService/GetQuote" + - "Response")] - [System.ServiceModel.XmlSerializerFormatAttribute()] - Spring.Ws.Samples.Stock.Client.Wcf.StockQuoteResponse StockQuote(Spring.Ws.Samples.Stock.Client.Wcf.StockQuoteRequest request); - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] - [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] - public partial class StockQuoteRequest - { - - [System.ServiceModel.MessageBodyMemberAttribute(Name="StockQuoteRequest", Namespace="http://www.springframework.org/spring-ws/samples/stockquote", Order=0)] - [System.Xml.Serialization.XmlArrayItemAttribute("Symbol", IsNullable=false)] - public string[] StockQuoteRequest1; - - public StockQuoteRequest() - { - } - - public StockQuoteRequest(string[] StockQuoteRequest1) - { - this.StockQuoteRequest1 = StockQuoteRequest1; - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] - [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] - public partial class StockQuoteResponse - { - - [System.ServiceModel.MessageBodyMemberAttribute(Name="StockQuoteResponse", Namespace="http://www.springframework.org/spring-ws/samples/stockquote", Order=0)] - [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] - public StockQuote[] StockQuoteResponse1; - - public StockQuoteResponse() - { - } - - public StockQuoteResponse(StockQuote[] StockQuoteResponse1) - { - this.StockQuoteResponse1 = StockQuoteResponse1; - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] - public interface StockChannel : Spring.Ws.Samples.Stock.Client.Wcf.Stock, System.ServiceModel.IClientChannel - { - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] - public partial class StockClient : System.ServiceModel.ClientBase, Spring.Ws.Samples.Stock.Client.Wcf.Stock - { - - public StockClient() - { - } - - public StockClient(string endpointConfigurationName) : - base(endpointConfigurationName) - { - } - - public StockClient(string endpointConfigurationName, string remoteAddress) : - base(endpointConfigurationName, remoteAddress) - { - } - - public StockClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : - base(endpointConfigurationName, remoteAddress) - { - } - - public StockClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : - base(binding, remoteAddress) - { - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - Spring.Ws.Samples.Stock.Client.Wcf.StockQuoteResponse Spring.Ws.Samples.Stock.Client.Wcf.Stock.StockQuote(Spring.Ws.Samples.Stock.Client.Wcf.StockQuoteRequest request) - { - return base.Channel.StockQuote(request); - } - - public StockQuote[] StockQuote(string[] StockQuoteRequest1) - { - Spring.Ws.Samples.Stock.Client.Wcf.StockQuoteRequest inValue = new Spring.Ws.Samples.Stock.Client.Wcf.StockQuoteRequest(); - inValue.StockQuoteRequest1 = StockQuoteRequest1; - Spring.Ws.Samples.Stock.Client.Wcf.StockQuoteResponse retVal = ((Spring.Ws.Samples.Stock.Client.Wcf.Stock)(this)).StockQuote(inValue); - return retVal.StockQuoteResponse1; - } - } -} diff --git a/samples/stockquote/client/wcf/src/client.exe.config b/samples/stockquote/client/wcf/src/client.exe.config deleted file mode 100644 index 75a57f8f..00000000 --- a/samples/stockquote/client/wcf/src/client.exe.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/stockquote/pom.xml b/samples/stockquote/pom.xml deleted file mode 100644 index 072b94e2..00000000 --- a/samples/stockquote/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - spring-ws-samples - org.springframework.ws - 2.0.0-M1-SNAPSHOT - ../samples/pom.xml - - 4.0.0 - stockquote - jar - Spring WS Stock Quote Sample - A Spring-WS sample that shows usage of WS-Addressing and the HTTP Server built into JDK 1.6. - - - - maven-javadoc-plugin - - ${basedir}/../../src/main/javadoc/javadoc.css - - - - - - - java.net - Java.net Repository for Maven2 - http://download.java.net/maven/1/ - legacy - - - - - - maven-compiler-plugin - - 1.5 - 1.5 - - - - com.sun.tools.xjc.maven2 - maven-jaxb-plugin - - - generate-sources - - generate - - - - - org.springframework.ws.samples.stockquote.schema - - stockquote.wsdl - - src/main/resources/org/springframework/ws/samples/stockquote/ws - -wsdl - - - - org.codehaus.mojo - exec-maven-plugin - - - - java - - - - - org.springframework.ws.samples.stockquote.Driver - - - - - - - - - org.springframework.ws - spring-ws-core-tiger - - - org.springframework.ws - spring-ws-support - - - - org.easymock - easymock - test - 2.2 - - - \ No newline at end of file diff --git a/samples/stockquote/server/pom.xml b/samples/stockquote/server/pom.xml new file mode 100644 index 00000000..ce8ff7aa --- /dev/null +++ b/samples/stockquote/server/pom.xml @@ -0,0 +1,61 @@ + + + stockquote + org.springframework.ws + 2.0.0-M1-SNAPSHOT + ../pom.xml + + 4.0.0 + stockquote-server + jar + Spring WS Stock Quote Sample - Server + A Spring-WS sample that shows usage of WS-Addressing and the HTTP Server built into JDK 1.6. + + + + org.codehaus.mojo + jaxb2-maven-plugin + + + + xjc + + + + + src/main/resources/org/springframework/ws/samples/stockquote/ws + stockquote.wsdl + org.springframework.ws.samples.stockquote.schema + true + false + + + + org.codehaus.mojo + exec-maven-plugin + + + + java + + + + + org.springframework.ws.samples.stockquote.Driver + + + + + + + + + org.springframework.ws + spring-ws-core + + + org.springframework.ws + spring-ws-support + + + \ No newline at end of file diff --git a/samples/stockquote/src/main/java/org/springframework/ws/samples/stockquote/Driver.java b/samples/stockquote/server/src/main/java/org/springframework/ws/samples/stockquote/Driver.java similarity index 100% rename from samples/stockquote/src/main/java/org/springframework/ws/samples/stockquote/Driver.java rename to samples/stockquote/server/src/main/java/org/springframework/ws/samples/stockquote/Driver.java diff --git a/samples/stockquote/src/main/java/org/springframework/ws/samples/stockquote/ws/StockService.java b/samples/stockquote/server/src/main/java/org/springframework/ws/samples/stockquote/ws/StockService.java similarity index 100% rename from samples/stockquote/src/main/java/org/springframework/ws/samples/stockquote/ws/StockService.java rename to samples/stockquote/server/src/main/java/org/springframework/ws/samples/stockquote/ws/StockService.java diff --git a/samples/stockquote/src/main/resources/log4j.properties b/samples/stockquote/server/src/main/resources/log4j.properties similarity index 100% rename from samples/stockquote/src/main/resources/log4j.properties rename to samples/stockquote/server/src/main/resources/log4j.properties diff --git a/samples/stockquote/src/main/resources/org/springframework/ws/samples/stockquote/applicationContext.xml b/samples/stockquote/server/src/main/resources/org/springframework/ws/samples/stockquote/applicationContext.xml similarity index 100% rename from samples/stockquote/src/main/resources/org/springframework/ws/samples/stockquote/applicationContext.xml rename to samples/stockquote/server/src/main/resources/org/springframework/ws/samples/stockquote/applicationContext.xml diff --git a/samples/stockquote/src/main/resources/org/springframework/ws/samples/stockquote/ws/applicationContext-ws.xml b/samples/stockquote/server/src/main/resources/org/springframework/ws/samples/stockquote/ws/applicationContext-ws.xml similarity index 100% rename from samples/stockquote/src/main/resources/org/springframework/ws/samples/stockquote/ws/applicationContext-ws.xml rename to samples/stockquote/server/src/main/resources/org/springframework/ws/samples/stockquote/ws/applicationContext-ws.xml diff --git a/samples/stockquote/src/main/resources/org/springframework/ws/samples/stockquote/ws/stockquote.wsdl b/samples/stockquote/server/src/main/resources/org/springframework/ws/samples/stockquote/ws/stockquote.wsdl similarity index 100% rename from samples/stockquote/src/main/resources/org/springframework/ws/samples/stockquote/ws/stockquote.wsdl rename to samples/stockquote/server/src/main/resources/org/springframework/ws/samples/stockquote/ws/stockquote.wsdl