From a716ef843838784098256e1c8cc30c60a3dde38a Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Fri, 18 May 2018 20:21:11 +0200 Subject: [PATCH] add excercies to WCF --- .../2018-05-05-services/IFirstService.cs | 1 - .../2018-05-05_service-client/Program.cs | 2 +- .../2018-05-18_wcf_client.sln | 25 +++ .../2018-05-18_wcf_client.csproj | 94 ++++++++ .../2018-05-18_wcf_client/App.config | 41 ++++ .../Service/FirstService.disco | 4 + .../Service/FirstService.wsdl | 77 +++++++ .../Service/FirstService.xsd | 43 ++++ .../Service/FirstService1.xsd | 12 ++ .../Service/FirstService2.xsd | 42 ++++ .../Connected Services/Service/Reference.cs | 183 ++++++++++++++++ .../Service/Reference.svcmap | 35 +++ ...8_wcf_client.Service.MotorCycle.datasource | 10 + .../Service/configuration.svcinfo | 10 + .../Service/configuration91.svcinfo | 201 ++++++++++++++++++ .../2018-05-18_wcf_client/Program.cs | 39 ++++ .../Properties/AssemblyInfo.cs | 36 ++++ .../2018-05-18_wcf_host.sln | 25 +++ .../2018-05-18_wcf_host.csproj | 146 +++++++++++++ .../2018-05-18_wcf_host/FirstService.svc | 1 + .../2018-05-18_wcf_host/FirstService.svc.cs | 36 ++++ .../2018-05-18_wcf_host/Global.asax | 1 + .../2018-05-18_wcf_host/Global.asax.cs | 16 ++ .../2018-05-18_wcf_host/IFirstService.cs | 34 +++ .../Properties/AssemblyInfo.cs | 35 +++ .../2018-05-18_wcf_host/Web.Debug.config | 30 +++ .../2018-05-18_wcf_host/Web.Release.config | 31 +++ .../2018-05-18_wcf_host/Web.config | 35 +++ .../2018-05-18_wcf_host/WebForm1.aspx | 15 ++ .../2018-05-18_wcf_host/WebForm1.aspx.cs | 17 ++ .../WebForm1.aspx.designer.cs | 26 +++ .../2018-05-18_wcf_host/packages.config | 5 + 32 files changed, 1306 insertions(+), 2 deletions(-) create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client.sln create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/2018-05-18_wcf_client.csproj create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/App.config create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.disco create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.wsdl create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.xsd create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService1.xsd create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService2.xsd create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/Reference.cs create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/Reference.svcmap create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/_2018_05_18_wcf_client.Service.MotorCycle.datasource create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/configuration.svcinfo create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/configuration91.svcinfo create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Program.cs create mode 100644 oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Properties/AssemblyInfo.cs create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host.sln create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/2018-05-18_wcf_host.csproj create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/FirstService.svc create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/FirstService.svc.cs create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Global.asax create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Global.asax.cs create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/IFirstService.cs create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Properties/AssemblyInfo.cs create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.Debug.config create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.Release.config create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.config create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx.cs create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx.designer.cs create mode 100644 oop/2018-05-18_wcf_host/2018-05-18_wcf_host/packages.config diff --git a/oop/2018-05-05-services/2018-05-05-services/IFirstService.cs b/oop/2018-05-05-services/2018-05-05-services/IFirstService.cs index ee5979d..a60d3ad 100644 --- a/oop/2018-05-05-services/2018-05-05-services/IFirstService.cs +++ b/oop/2018-05-05-services/2018-05-05-services/IFirstService.cs @@ -13,6 +13,5 @@ namespace _2018_05_05_services { [OperationContract] string HelloWorld(); - [DataContract] } } diff --git a/oop/2018-05-05_service-client/2018-05-05_service-client/Program.cs b/oop/2018-05-05_service-client/2018-05-05_service-client/Program.cs index 8b0cf33..0bdfc7a 100644 --- a/oop/2018-05-05_service-client/2018-05-05_service-client/Program.cs +++ b/oop/2018-05-05_service-client/2018-05-05_service-client/Program.cs @@ -8,7 +8,7 @@ namespace _2018_05_05_service_client static void Main(string[] args) { FirstServiceClient something = new FirstServiceClient(); - string newstring = something.HelloWorld(); + string newstring = something.; } } } diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client.sln b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client.sln new file mode 100644 index 0000000..b6dfdb8 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2037 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2018-05-18_wcf_client", "2018-05-18_wcf_client\2018-05-18_wcf_client.csproj", "{22BBF342-34C9-4687-89BC-6588E8155CAC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {22BBF342-34C9-4687-89BC-6588E8155CAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22BBF342-34C9-4687-89BC-6588E8155CAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22BBF342-34C9-4687-89BC-6588E8155CAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22BBF342-34C9-4687-89BC-6588E8155CAC}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E1C464BE-AEBE-4C71-9B2C-6D898BC1904F} + EndGlobalSection +EndGlobal diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/2018-05-18_wcf_client.csproj b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/2018-05-18_wcf_client.csproj new file mode 100644 index 0000000..96fee76 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/2018-05-18_wcf_client.csproj @@ -0,0 +1,94 @@ + + + + + Debug + AnyCPU + {22BBF342-34C9-4687-89BC-6588E8155CAC} + Exe + _2018_05_18_wcf_client + 2018-05-18_wcf_client + v4.6.1 + 512 + true + True + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + True + True + Reference.svcmap + + + + + + + + + Designer + + + Designer + + + Designer + + + Reference.svcmap + + + + + + + + + + + + + + + + + + + + WCF Proxy Generator + Reference.cs + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/App.config b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/App.config new file mode 100644 index 0000000..aae9a3e --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/App.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.disco b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.disco new file mode 100644 index 0000000..f87bf89 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.disco @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.wsdl b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.wsdl new file mode 100644 index 0000000..51d34f1 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.wsdl @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.xsd b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.xsd new file mode 100644 index 0000000..becf090 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService.xsd @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService1.xsd b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService1.xsd new file mode 100644 index 0000000..5c69430 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService1.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService2.xsd b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService2.xsd new file mode 100644 index 0000000..d58e7f3 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/FirstService2.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/Reference.cs b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/Reference.cs new file mode 100644 index 0000000..91defa6 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/Reference.cs @@ -0,0 +1,183 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace _2018_05_18_wcf_client.Service { + using System.Runtime.Serialization; + using System; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="MotorCycle", Namespace="http://schemas.datacontract.org/2004/07/_2018_05_18_wcf_host")] + [System.SerializableAttribute()] + public partial class MotorCycle : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string BrandField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private bool HasSideCartField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private int IDField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private int NumberOfWheelsField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData { + get { + return this.extensionDataField; + } + set { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string Brand { + get { + return this.BrandField; + } + set { + if ((object.ReferenceEquals(this.BrandField, value) != true)) { + this.BrandField = value; + this.RaisePropertyChanged("Brand"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public bool HasSideCart { + get { + return this.HasSideCartField; + } + set { + if ((this.HasSideCartField.Equals(value) != true)) { + this.HasSideCartField = value; + this.RaisePropertyChanged("HasSideCart"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int ID { + get { + return this.IDField; + } + set { + if ((this.IDField.Equals(value) != true)) { + this.IDField = value; + this.RaisePropertyChanged("ID"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int NumberOfWheels { + get { + return this.NumberOfWheelsField; + } + set { + if ((this.NumberOfWheelsField.Equals(value) != true)) { + this.NumberOfWheelsField = value; + this.RaisePropertyChanged("NumberOfWheels"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="Service.IFirstService")] + public interface IFirstService { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IFirstService/GetCurrentDate", ReplyAction="http://tempuri.org/IFirstService/GetCurrentDateResponse")] + System.DateTime GetCurrentDate(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IFirstService/GetCurrentDate", ReplyAction="http://tempuri.org/IFirstService/GetCurrentDateResponse")] + System.Threading.Tasks.Task GetCurrentDateAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IFirstService/Multiply", ReplyAction="http://tempuri.org/IFirstService/MultiplyResponse")] + int Multiply(int _a, int _b); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IFirstService/Multiply", ReplyAction="http://tempuri.org/IFirstService/MultiplyResponse")] + System.Threading.Tasks.Task MultiplyAsync(int _a, int _b); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IFirstService/GetMotorCycle", ReplyAction="http://tempuri.org/IFirstService/GetMotorCycleResponse")] + _2018_05_18_wcf_client.Service.MotorCycle GetMotorCycle(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IFirstService/GetMotorCycle", ReplyAction="http://tempuri.org/IFirstService/GetMotorCycleResponse")] + System.Threading.Tasks.Task<_2018_05_18_wcf_client.Service.MotorCycle> GetMotorCycleAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface IFirstServiceChannel : _2018_05_18_wcf_client.Service.IFirstService, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class FirstServiceClient : System.ServiceModel.ClientBase<_2018_05_18_wcf_client.Service.IFirstService>, _2018_05_18_wcf_client.Service.IFirstService { + + public FirstServiceClient() { + } + + public FirstServiceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public FirstServiceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public FirstServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public FirstServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + public System.DateTime GetCurrentDate() { + return base.Channel.GetCurrentDate(); + } + + public System.Threading.Tasks.Task GetCurrentDateAsync() { + return base.Channel.GetCurrentDateAsync(); + } + + public int Multiply(int _a, int _b) { + return base.Channel.Multiply(_a, _b); + } + + public System.Threading.Tasks.Task MultiplyAsync(int _a, int _b) { + return base.Channel.MultiplyAsync(_a, _b); + } + + public _2018_05_18_wcf_client.Service.MotorCycle GetMotorCycle() { + return base.Channel.GetMotorCycle(); + } + + public System.Threading.Tasks.Task<_2018_05_18_wcf_client.Service.MotorCycle> GetMotorCycleAsync() { + return base.Channel.GetMotorCycleAsync(); + } + } +} diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/Reference.svcmap b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/Reference.svcmap new file mode 100644 index 0000000..bdf76b8 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/Reference.svcmap @@ -0,0 +1,35 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/_2018_05_18_wcf_client.Service.MotorCycle.datasource b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/_2018_05_18_wcf_client.Service.MotorCycle.datasource new file mode 100644 index 0000000..e70f1ae --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/_2018_05_18_wcf_client.Service.MotorCycle.datasource @@ -0,0 +1,10 @@ + + + + _2018_05_18_wcf_client.Service.MotorCycle, Connected Services.Service.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/configuration.svcinfo b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/configuration.svcinfo new file mode 100644 index 0000000..c87b117 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/configuration91.svcinfo b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/configuration91.svcinfo new file mode 100644 index 0000000..dcef76b --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Connected Services/Service/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + BasicHttpBinding_IFirstService + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://localhost:50399/FirstService.svc + + + + + + basicHttpBinding + + + BasicHttpBinding_IFirstService + + + Service.IFirstService + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + BasicHttpBinding_IFirstService + + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Program.cs b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Program.cs new file mode 100644 index 0000000..7e7e384 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Program.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using _2018_05_18_wcf_client.Service; + +namespace _2018_05_18_wcf_client +{ + class Program + { + static void Main(string[] args) + { + FirstServiceClient client = new FirstServiceClient(); + + Console.WriteLine("Get Date"); + Console.WriteLine(client.GetCurrentDate()); + Console.WriteLine(); + Console.WriteLine("Multiply 2 and 8"); + Console.WriteLine(client.Multiply(2, 8)); + Console.WriteLine(); + Console.WriteLine("Get a bike"); + MotorCycle bike = client.GetMotorCycle(); + Console.WriteLine("Write Bike ID"); + Console.WriteLine(bike.ID); + Console.WriteLine("Number of Wheels"); + Console.WriteLine(bike.NumberOfWheels); + Console.WriteLine("Brand"); + Console.WriteLine(bike.Brand); + Console.WriteLine("Has Side Cart"); + Console.WriteLine(bike.HasSideCart); + // Use the 'client' variable to call operations on the service. + + // Always close the client. + client.Close(); + Console.ReadKey(); + } + } +} diff --git a/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Properties/AssemblyInfo.cs b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..54614a9 --- /dev/null +++ b/oop/2018-05-18_wcf_client/2018-05-18_wcf_client/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("2018-05-18_wcf_client")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("2018-05-18_wcf_client")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("22bbf342-34c9-4687-89bc-6588e8155cac")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host.sln b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host.sln new file mode 100644 index 0000000..243b0f3 --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2037 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2018-05-18_wcf_host", "2018-05-18_wcf_host\2018-05-18_wcf_host.csproj", "{D1A5B681-993E-41C8-BFD4-028BE4D43C2F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D1A5B681-993E-41C8-BFD4-028BE4D43C2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1A5B681-993E-41C8-BFD4-028BE4D43C2F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1A5B681-993E-41C8-BFD4-028BE4D43C2F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1A5B681-993E-41C8-BFD4-028BE4D43C2F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6C1C471D-4FF7-4E5A-8B64-48890B7B434A} + EndGlobalSection +EndGlobal diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/2018-05-18_wcf_host.csproj b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/2018-05-18_wcf_host.csproj new file mode 100644 index 0000000..c3b65ed --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/2018-05-18_wcf_host.csproj @@ -0,0 +1,146 @@ + + + + + + Debug + AnyCPU + + + 2.0 + {D1A5B681-993E-41C8-BFD4-028BE4D43C2F} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + _2018_05_18_wcf_host + 2018-05-18_wcf_host + v4.6.1 + true + + + + + + + + + True + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + true + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + FirstService.svc + + + Global.asax + + + + + WebForm1.aspx + ASPXCodeBehind + + + WebForm1.aspx + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + True + True + 50399 + / + http://localhost:50399/ + False + False + + + False + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/FirstService.svc b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/FirstService.svc new file mode 100644 index 0000000..32d0fec --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/FirstService.svc @@ -0,0 +1 @@ +<%@ ServiceHost Language="C#" Debug="true" Service="_2018_05_18_wcf_host.FirstService" CodeBehind="FirstService.svc.cs" %> diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/FirstService.svc.cs b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/FirstService.svc.cs new file mode 100644 index 0000000..1bd8514 --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/FirstService.svc.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.ServiceModel; +using System.Text; + +namespace _2018_05_18_wcf_host +{ + // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "FirstService" in code, svc and config file together. + // NOTE: In order to launch WCF Test Client for testing this service, please select FirstService.svc or FirstService.svc.cs at the Solution Explorer and start debugging. + public class FirstService : IFirstService + { + public DateTime GetCurrentDate() + { + return DateTime.Now; + } + + public MotorCycle GetMotorCycle() + { + MotorCycle m = new MotorCycle + { + ID = 1, + NumberOfWheels = 2, + Brand = "Harley", + HasSideCart = false + }; + return m; + } + + public int Multiply(int _a, int _b) + { + return (_a * _b); + } + } +} diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Global.asax b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Global.asax new file mode 100644 index 0000000..9357f11 --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Global.asax @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="_2018_05_18_wcf_host.Global" Language="C#" %> diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Global.asax.cs b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Global.asax.cs new file mode 100644 index 0000000..2113cbc --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Global.asax.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Security; +using System.Web.SessionState; + +namespace _2018_05_18_wcf_host +{ + public class Global : System.Web.HttpApplication + { + protected void Application_Start(object sender, EventArgs e) + { + } + } +} \ No newline at end of file diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/IFirstService.cs b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/IFirstService.cs new file mode 100644 index 0000000..f159fde --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/IFirstService.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.ServiceModel; +using System.Text; + +namespace _2018_05_18_wcf_host +{ + // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IFirstService" in both code and config file together. + [ServiceContract] + public interface IFirstService + { + [OperationContract] + DateTime GetCurrentDate(); + [OperationContract] + int Multiply(int _a, int _b); + [OperationContract] + MotorCycle GetMotorCycle(); + } + + [DataContract] + public class MotorCycle + { + [DataMember] + public int ID { get; set; } + [DataMember] + public int NumberOfWheels { get; set; } + [DataMember] + public string Brand { get; set; } + [DataMember] + public bool HasSideCart { get; set; } + } +} \ No newline at end of file diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Properties/AssemblyInfo.cs b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f1d489a --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("_2018_05_18_wcf_host")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("_2018_05_18_wcf_host")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d1a5b681-993e-41c8-bfd4-028be4d43c2f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.Debug.config b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.Debug.config new file mode 100644 index 0000000..fae9cfe --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.Release.config b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.Release.config new file mode 100644 index 0000000..da6e960 --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.config b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.config new file mode 100644 index 0000000..ade67d1 --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/Web.config @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx new file mode 100644 index 0000000..88e19ed --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx @@ -0,0 +1,15 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="_2018_05_18_wcf_host.WebForm1" %> + + + + + + + + +
+
+
+
+ + diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx.cs b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx.cs new file mode 100644 index 0000000..59f9aa9 --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace _2018_05_18_wcf_host +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx.designer.cs b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..6aff4de --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/WebForm1.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace _2018_05_18_wcf_host +{ + + + public partial class WebForm1 + { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/packages.config b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/packages.config new file mode 100644 index 0000000..3c54ec7 --- /dev/null +++ b/oop/2018-05-18_wcf_host/2018-05-18_wcf_host/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file