From c1a2eab8d1ff6dc25eafcfc32eb1d10ffac0d9e1 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Sun, 11 Nov 2007 21:32:53 +0000 Subject: [PATCH] Updated C# sample --- samples/airline/client/cs/Makefile | 3 - samples/airline/client/cs/bin/airline.exe | Bin 9728 -> 0 bytes samples/airline/client/cs/bin/getmileage.exe | Bin 6144 -> 0 bytes .../airline/client/cs/build-getmileage.bat | 4 - samples/airline/client/cs/build-wse.bat | 3 - samples/airline/client/cs/build.bat | 2 - samples/airline/client/cs/build.xml | 50 +++++ samples/airline/client/cs/readme.txt | 22 +- .../client/cs/src/AirlineService-wse.cs | 78 ------- .../airline/client/cs/src/AirlineService.cs | 204 ------------------ samples/airline/client/cs/src/wse.cs | 32 --- 11 files changed, 56 insertions(+), 342 deletions(-) delete mode 100644 samples/airline/client/cs/Makefile delete mode 100755 samples/airline/client/cs/bin/airline.exe delete mode 100755 samples/airline/client/cs/bin/getmileage.exe delete mode 100644 samples/airline/client/cs/build-getmileage.bat delete mode 100644 samples/airline/client/cs/build-wse.bat delete mode 100644 samples/airline/client/cs/build.bat create mode 100644 samples/airline/client/cs/build.xml delete mode 100644 samples/airline/client/cs/src/AirlineService-wse.cs delete mode 100644 samples/airline/client/cs/src/AirlineService.cs delete mode 100644 samples/airline/client/cs/src/wse.cs diff --git a/samples/airline/client/cs/Makefile b/samples/airline/client/cs/Makefile deleted file mode 100644 index 73ba3c86..00000000 --- a/samples/airline/client/cs/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -target: - wsdl -namespace:Spring.Ws.Samples.Airline.Client.CSharp -out:src/AirlineService.cs ../../src/main/webapp/airline.wsdl - mcs -out:bin/airline.exe -r:System.Web.Services src/main.cs src/AirlineService.cs diff --git a/samples/airline/client/cs/bin/airline.exe b/samples/airline/client/cs/bin/airline.exe deleted file mode 100755 index aeba45fbd5a45ca2dc3f899701fef3a74337b425..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9728 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Ub6pf8B_{5~hz z^ZN?!j92z}Aqy_{aY`do)^hsj0~(E7w(a_MiUu4x`$)WIHy+^XN3$F+#}f{R9rBt# zUvjtF%V=!1k76f5yf+Ty`g4Q*{r$QAt@a3xM%eCdEW6cEIi;=kM0L94*UZ2`VX)uX;bfXUaXKKvhnMk}!?u!Fo*d>R#(1AP61<=B88FZ3iEp7i z_$%VQgaO7InD5B% zspnrU+v=yTE7|tHoDH>XD`=FhcVjKP-s@3*RHKQ@PSQ&pimwd$We)kh8jf~Y!YTvx(o_&0&{bUtax-yGK=I@F(vFO|QR=f61Y=~(1ZV_DcVneP+Yh$k9Z;1i1p?`H}T@U;ht@>y@ diff --git a/samples/airline/client/cs/bin/getmileage.exe b/samples/airline/client/cs/bin/getmileage.exe deleted file mode 100755 index 4f38d57d029635e456058f838833b096f2a2e622..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6144 zcmeHLU2GiH75?t-dTnoFhg~;;KvE_ofT3jUgwTfY=YL}w$0i#Giqe|#?)7@ecxE#* zj%_Mv!~+FH3so!Bma3vsAE?@@R7EO6Dil$vr7aJYS|lEdkcxP!)ISNeRZIGvJG1sW zae%^0k$Ts2=ANH>?z!JR_h&qQ$D_ys$niOS8hD0pDSd{%GdV?d=f%%<;_3F6cRZsG zzP#heoEus7FsOyjyj5|0KZvavZG{WI<@(mpMA@1Ts@m@8DC|mIPYweIRTlq#=o>?g z-d;zi+Mx2ld6e)a#qS}p`1J7+V)2zp;%3dnFK?XUL%9@=i^HN5@w4(ySrM^pqu&Xs z^zl!CIJ4XdY&=u;UU&;=YqD!2e{&OW$9gFyA8#U|&cv9;P0kbxxYG`!utLtn*2fA* zgc6^o(nqx&YA>LniSvddLikJ8!rzjdAGMO- z*cuSRLeMUxK++a$AiXT#DqOy!Jz$`PphHL}NjI@9bmh7^-G%T?x+&%!-po*fA_cGY zcC~a9xI$a*QjsVjU8`77C~tG5M=O7ga$&$V=4xMI=O zn=$ii+Go2jYA720CVv0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NLAtC;mc_FSb0EBz&YaSrP;+cc0lz!s_XC)eWW z(PxEyc#Jk+v@!AB&v@lI8(ol5d9H@Wgxny*$HTTTpb`aKj64~y>s3%Ge+a4!5YQS_xLc%9V;_h?Vfg57bN3F^VaL$qy9ndWR|UD!K6hL+Q7% zY%8CUx+S%p;4(PiGSCvb@T80kpzUl;r&_oufTc$fAtpznAd-ytW)ssy>O&4a ziK#Ju;mn~%|L+`Ig6$;z$nms5%;KhzC4KEPc&)WL6SY;m1Uv8u5{&y9ab)73F-L{P gyj_d-neEH~KkURx{{K;LEVvK*c>W*%e}%w*0Qk1;h5!Hn diff --git a/samples/airline/client/cs/build-getmileage.bat b/samples/airline/client/cs/build-getmileage.bat deleted file mode 100644 index fdbc6f7d..00000000 --- a/samples/airline/client/cs/build-getmileage.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -set WSE_PATH="C:\Program Files\Microsoft WSE\v2.0" -%WSE_PATH%\Tools\Wsdl\WseWsdl2 ..\..\src\main\webapp\airline.wsdl src\AirlineService-wse.cs -csc -nologo -out:bin\getmileage.exe -reference:%WSE_PATH%\Microsoft.Web.Services2.dll src\wse.cs src\AirlineService-wse.cs \ No newline at end of file diff --git a/samples/airline/client/cs/build-wse.bat b/samples/airline/client/cs/build-wse.bat deleted file mode 100644 index 9c2bdc23..00000000 --- a/samples/airline/client/cs/build-wse.bat +++ /dev/null @@ -1,3 +0,0 @@ -set WSE_PATH="C:\Program Files\Microsoft WSE\v2.0" -%WSE_PATH%\Tools\Wsdl\WseWsdl2 ..\..\src\main\webapp\airline.wsdl src\AirlineService-wse.cs -csc -out:bin\airline-wse.exe -reference:%WSE_PATH%\Microsoft.Web.Services2.dll src\wse.cs src\AirlineService-wse.cs \ No newline at end of file diff --git a/samples/airline/client/cs/build.bat b/samples/airline/client/cs/build.bat deleted file mode 100644 index 4105ccbf..00000000 --- a/samples/airline/client/cs/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -wsdl -out:src\AirlineService.cs ..\..\src\webapp\airline.wsdl ..\..\src\webapp\airline.xsd -csc -out:bin\airline.exe src\main.cs src\AirlineService.cse.csosoft WSE\v2.0\Microsoft.Web.Services2.dll" -define:WSE src\main.cs src\AirlineService.cs \ No newline at end of file diff --git a/samples/airline/client/cs/build.xml b/samples/airline/client/cs/build.xml new file mode 100644 index 00000000..0c4d653a --- /dev/null +++ b/samples/airline/client/cs/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/airline/client/cs/readme.txt b/samples/airline/client/cs/readme.txt index d8ba2d63..787955f8 100644 --- a/samples/airline/client/cs/readme.txt +++ b/samples/airline/client/cs/readme.txt @@ -1,20 +1,10 @@ SPRING WEB SERVICES -This directory contains two C# clients for the Airline Web Service. One sample (airline.exe) uses non-secure -functionality, and works under both .NET and Mono, while getmileage.exe only works under .NET because it relies on -Microsoft's Web Services enhancements (WSE 2.0) to perform WS-Security. +This directory contains a .NET client for the Airline Web Service. +The client can be run from the provided ant file, by calling "ant run". -The C# client is executable: just run the executable file and (if the war file is deployed at the default -http://localhost:8080/airline) the web service will be called, causing a flight reservations to be created. - -If the web service is NOT running at the default URL, you can append the URL argument to the exectuable file -(e.g. 'airline.exe http://localhost:8080/airline-webservice/Airline'). - - -C# Client Sample table of contents +SAJA Client Sample table of contents --------------------------------------------------- -* bin - The executable files for the clients: airline.exe and getmileage.exe -* src - The source files for the clients. -* Makefile - Mono makefile. -* build.bat - .NET build batch file for airline.exe -* build-getmileage.bat - .NET build batch file for getmileage.exe \ No newline at end of file +* src - The source files for the client +* build.xml - Ant build file with a 'build' and a 'run' target + diff --git a/samples/airline/client/cs/src/AirlineService-wse.cs b/samples/airline/client/cs/src/AirlineService-wse.cs deleted file mode 100644 index ec6afb95..00000000 --- a/samples/airline/client/cs/src/AirlineService-wse.cs +++ /dev/null @@ -1,78 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version: 1.1.4322.2032 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -// -// InfoVersionComment, WseWsdl2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=26ba029e599ec4f8, RunTime Version: 1.1.4322.2032 -// -using System; -using System.Xml; -using Microsoft.Web.Services2; -using Microsoft.Web.Services2.Addressing; -using Microsoft.Web.Services2.Messaging; -using System.Xml.Serialization; - - -[SoapService("http://www.springframework.org/spring-ws/samples/airline/definitions")] -public class AirlineService : SoapClient -{ - public AirlineService() : base( new Uri("http://localhost:8080/airline/Airline") ) - { - } - - [SoapMethod("http://www.springframework.org/spring-ws/samples/airline/GetFlights")] - public SoapEnvelope GetFlights( SoapEnvelope request ) - { - return base.SendRequestResponse("GetFlights", request); - } - - public IAsyncResult BeginGetFlights( SoapEnvelope request, System.AsyncCallback callback, object asyncState) - { - return base.BeginSendRequestResponse("GetFlights", request, callback, asyncState); - } - - public SoapEnvelope EndGetFlights( System.IAsyncResult asyncResult ) - { - return base.EndSendRequestResponse(asyncResult); - } - - [SoapMethod("http://www.springframework.org/spring-ws/samples/airline/BookFlight")] - public SoapEnvelope BookFlight( SoapEnvelope request ) - { - return base.SendRequestResponse("BookFlight", request); - } - - public IAsyncResult BeginBookFlight( SoapEnvelope request, System.AsyncCallback callback, object asyncState) - { - return base.BeginSendRequestResponse("BookFlight", request, callback, asyncState); - } - - public SoapEnvelope EndBookFlight( System.IAsyncResult asyncResult ) - { - return base.EndSendRequestResponse(asyncResult); - } - - [SoapMethod("http://www.springframework.org/spring-ws/samples/airline/GetFrequentFlyerMileage")] - public SoapEnvelope GetFrequentFlyerMileage( SoapEnvelope request ) - { - return base.SendRequestResponse("GetFrequentFlyerMileage", request); - } - - public IAsyncResult BeginGetFrequentFlyerMileage( SoapEnvelope request, System.AsyncCallback callback, object asyncState) - { - return base.BeginSendRequestResponse("GetFrequentFlyerMileage", request, callback, asyncState); - } - - public SoapEnvelope EndGetFrequentFlyerMileage( System.IAsyncResult asyncResult ) - { - return base.EndSendRequestResponse(asyncResult); - } - -} - diff --git a/samples/airline/client/cs/src/AirlineService.cs b/samples/airline/client/cs/src/AirlineService.cs deleted file mode 100644 index 948a9290..00000000 --- a/samples/airline/client/cs/src/AirlineService.cs +++ /dev/null @@ -1,204 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 1.1.4322.2032 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -// -// This source code was auto-generated by Mono Web Services Description Language Utility -// -namespace Spring.Ws.Samples.Airline.Client.CSharp { - - - /// - [System.Web.Services.WebServiceBinding(Name="AirlinePort", Namespace="http://www.springframework.org/spring-ws/samples/airline/definitions")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public class AirlineService : System.Web.Services.Protocols.SoapHttpClientProtocol { - - public AirlineService() { - this.Url = "http://localhost:8080/airline/Airline"; - } - - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.springframework.org/spring-ws/samples/airline/GetFlights", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare, Use=System.Web.Services.Description.SoapBindingUse.Literal)] - [return: System.Xml.Serialization.XmlArray(ElementName="GetFlightsResponse", Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - [return: System.Xml.Serialization.XmlArrayItem(ElementName="flight", IsNullable=false)] - public Flight[] GetFlights([System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] MessageGetFlightsRequest GetFlightsRequest) { - object[] results = this.Invoke("GetFlights", new object[] { - GetFlightsRequest}); - return ((Flight[])(results[0])); - } - - public System.IAsyncResult BeginGetFlights(MessageGetFlightsRequest GetFlightsRequest, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetFlights", new object[] { - GetFlightsRequest}, callback, asyncState); - } - - public Flight[] EndGetFlights(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((Flight[])(results[0])); - } - - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.springframework.org/spring-ws/samples/airline/BookFlight", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare, Use=System.Web.Services.Description.SoapBindingUse.Literal)] - [return: System.Xml.Serialization.XmlElementAttribute("BookFlightResponse", Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public Ticket BookFlight([System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] MessageBookFlightRequest BookFlightRequest) { - object[] results = this.Invoke("BookFlight", new object[] { - BookFlightRequest}); - return ((Ticket)(results[0])); - } - - public System.IAsyncResult BeginBookFlight(MessageBookFlightRequest BookFlightRequest, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("BookFlight", new object[] { - BookFlightRequest}, callback, asyncState); - } - - public Ticket EndBookFlight(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((Ticket)(results[0])); - } - - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.springframework.org/spring-ws/samples/airline/GetFrequentFlyerMileage", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare, Use=System.Web.Services.Description.SoapBindingUse.Literal)] - [return: System.Xml.Serialization.XmlElementAttribute("GetFrequentFlyerMileageResponse", Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public int GetFrequentFlyerMileage([System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] object GetFrequentFlyerMileageRequest) { - object[] results = this.Invoke("GetFrequentFlyerMileage", new object[] { - GetFrequentFlyerMileageRequest}); - return ((int)(results[0])); - } - - public System.IAsyncResult BeginGetFrequentFlyerMileage(object GetFrequentFlyerMileageRequest, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetFrequentFlyerMileage", new object[] { - GetFrequentFlyerMileageRequest}, callback, asyncState); - } - - public int EndGetFrequentFlyerMileage(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - } - - /// - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - [System.Xml.Serialization.XmlRootAttribute("GetFlightsRequest", Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public class MessageGetFlightsRequest { - - /// - public string from; - - /// - public string to; - - /// - [System.Xml.Serialization.XmlElementAttribute(DataType="date")] - public System.DateTime departureDate; - - /// - public ServiceClass serviceClass; - - /// - [System.Xml.Serialization.XmlIgnore()] - public bool serviceClassSpecified; - } - - /// - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public enum ServiceClass { - - /// - economy, - - /// - business, - - /// - first, - } - - /// - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public class Flight { - - /// - public string number; - - /// - public System.DateTime departureTime; - - /// - public Airport from; - - /// - public System.DateTime arrivalTime; - - /// - public Airport to; - - /// - public ServiceClass serviceClass; - } - - /// - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public class Airport { - - /// - public string code; - - /// - public string name; - - /// - public string city; - } - - /// - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - [System.Xml.Serialization.XmlRootAttribute("BookFlightRequest", Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public class MessageBookFlightRequest { - - /// - public string flightNumber; - - /// - public System.DateTime departureTime; - - /// - [System.Xml.Serialization.XmlArrayItem(ElementName="passenger", Type=typeof(Name), IsNullable=false)] - [System.Xml.Serialization.XmlArrayItem(ElementName="username", Type=typeof(string), IsNullable=false)] - public object[] passengers; - } - - /// - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public class Name { - - /// - public string first; - - /// - public string last; - } - - /// - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - [System.Xml.Serialization.XmlRootAttribute("BookFlightResponse", Namespace="http://www.springframework.org/spring-ws/samples/airline/schemas")] - public class Ticket { - - /// - public long id; - - /// - [System.Xml.Serialization.XmlElementAttribute(DataType="date")] - public System.DateTime issueDate; - - /// - [System.Xml.Serialization.XmlArrayItem(ElementName="passenger", IsNullable=false)] - public Name[] passengers; - - /// - public Flight flight; - } -} diff --git a/samples/airline/client/cs/src/wse.cs b/samples/airline/client/cs/src/wse.cs deleted file mode 100644 index b5e83452..00000000 --- a/samples/airline/client/cs/src/wse.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Web; -using System.Web.Services.Protocols; -using System.Xml; -using Microsoft.Web.Services2; -using Microsoft.Web.Services2.Security; -using Microsoft.Web.Services2.Security.Tokens; - -namespace Spring.Ws.Samples.Airline.Client.CSharp { - - public class Client { - public static void Main(string[] args) { - try { - AirlineService service = new AirlineService(); - if (args.Length > 0) { - service.Destination = new Uri(args[0]); - } - SoapEnvelope request = new SoapEnvelope(); - request.SetBodyObject(@""); - UsernameToken userToken = new UsernameToken("john","changeme", PasswordOption.SendHashed); - request.Context.Security.Tokens.Add(userToken); - SoapEnvelope response = service.GetFrequentFlyerMileage(request); - int miles = XmlConvert.ToInt32(response.Body.FirstChild.InnerText); - Console.Out.WriteLine("'john' has {0} frequent flyer miles", miles); - } catch (SoapException ex) { - Console.Error.WriteLine("SOAP Fault Code {0}", ex.Code); - Console.Error.WriteLine("SOAP Fault String: {0}", ex.Message); - } - } - - } -}