|
| 1 | +//------------------------------------------------------------------------------ |
| 2 | +// <auto-generated> |
| 3 | +// This code was generated by a tool. |
| 4 | +// |
| 5 | +// Changes to this file may cause incorrect behavior and will be lost if |
| 6 | +// the code is regenerated. |
| 7 | +// </auto-generated> |
| 8 | +//------------------------------------------------------------------------------ |
| 9 | + |
| 10 | +namespace CoreWcf.Samples.TransportSecurity |
| 11 | +{ |
| 12 | + |
| 13 | + |
| 14 | + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] |
| 15 | + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="CoreWcf.Samples.TransportSecurity.ICalculatorService")] |
| 16 | + public interface ICalculatorService |
| 17 | + { |
| 18 | + |
| 19 | + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Add", ReplyAction="http://tempuri.org/ICalculatorService/AddResponse")] |
| 20 | + double Add(double n1, double n2); |
| 21 | + |
| 22 | + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Add", ReplyAction="http://tempuri.org/ICalculatorService/AddResponse")] |
| 23 | + System.Threading.Tasks.Task<double> AddAsync(double n1, double n2); |
| 24 | + |
| 25 | + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Subtract", ReplyAction="http://tempuri.org/ICalculatorService/SubtractResponse")] |
| 26 | + double Subtract(double n1, double n2); |
| 27 | + |
| 28 | + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Subtract", ReplyAction="http://tempuri.org/ICalculatorService/SubtractResponse")] |
| 29 | + System.Threading.Tasks.Task<double> SubtractAsync(double n1, double n2); |
| 30 | + |
| 31 | + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Multiply", ReplyAction="http://tempuri.org/ICalculatorService/MultiplyResponse")] |
| 32 | + double Multiply(double n1, double n2); |
| 33 | + |
| 34 | + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Multiply", ReplyAction="http://tempuri.org/ICalculatorService/MultiplyResponse")] |
| 35 | + System.Threading.Tasks.Task<double> MultiplyAsync(double n1, double n2); |
| 36 | + |
| 37 | + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Divide", ReplyAction="http://tempuri.org/ICalculatorService/DivideResponse")] |
| 38 | + double Divide(double n1, double n2); |
| 39 | + |
| 40 | + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Divide", ReplyAction="http://tempuri.org/ICalculatorService/DivideResponse")] |
| 41 | + System.Threading.Tasks.Task<double> DivideAsync(double n1, double n2); |
| 42 | + } |
| 43 | + |
| 44 | + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] |
| 45 | + public interface ICalculatorServiceChannel : CoreWcf.Samples.TransportSecurity.ICalculatorService, System.ServiceModel.IClientChannel |
| 46 | + { |
| 47 | + } |
| 48 | + |
| 49 | + [System.Diagnostics.DebuggerStepThroughAttribute()] |
| 50 | + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] |
| 51 | + public partial class CalculatorServiceClient : System.ServiceModel.ClientBase<CoreWcf.Samples.TransportSecurity.ICalculatorService>, CoreWcf.Samples.TransportSecurity.ICalculatorService |
| 52 | + { |
| 53 | + |
| 54 | + /// <summary> |
| 55 | + /// Implement this partial method to configure the service endpoint. |
| 56 | + /// </summary> |
| 57 | + /// <param name="serviceEndpoint">The endpoint to configure</param> |
| 58 | + /// <param name="clientCredentials">The client credentials</param> |
| 59 | + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); |
| 60 | + |
| 61 | + public CalculatorServiceClient() : |
| 62 | + base(CalculatorServiceClient.GetDefaultBinding(), CalculatorServiceClient.GetDefaultEndpointAddress()) |
| 63 | + { |
| 64 | + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_ICalculatorService.ToString(); |
| 65 | + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); |
| 66 | + } |
| 67 | + |
| 68 | + public CalculatorServiceClient(EndpointConfiguration endpointConfiguration) : |
| 69 | + base(CalculatorServiceClient.GetBindingForEndpoint(endpointConfiguration), CalculatorServiceClient.GetEndpointAddress(endpointConfiguration)) |
| 70 | + { |
| 71 | + this.Endpoint.Name = endpointConfiguration.ToString(); |
| 72 | + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); |
| 73 | + } |
| 74 | + |
| 75 | + public CalculatorServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : |
| 76 | + base(CalculatorServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) |
| 77 | + { |
| 78 | + this.Endpoint.Name = endpointConfiguration.ToString(); |
| 79 | + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); |
| 80 | + } |
| 81 | + |
| 82 | + public CalculatorServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : |
| 83 | + base(CalculatorServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) |
| 84 | + { |
| 85 | + this.Endpoint.Name = endpointConfiguration.ToString(); |
| 86 | + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); |
| 87 | + } |
| 88 | + |
| 89 | + public CalculatorServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : |
| 90 | + base(binding, remoteAddress) |
| 91 | + { |
| 92 | + } |
| 93 | + |
| 94 | + public double Add(double n1, double n2) |
| 95 | + { |
| 96 | + return base.Channel.Add(n1, n2); |
| 97 | + } |
| 98 | + |
| 99 | + public System.Threading.Tasks.Task<double> AddAsync(double n1, double n2) |
| 100 | + { |
| 101 | + return base.Channel.AddAsync(n1, n2); |
| 102 | + } |
| 103 | + |
| 104 | + public double Subtract(double n1, double n2) |
| 105 | + { |
| 106 | + return base.Channel.Subtract(n1, n2); |
| 107 | + } |
| 108 | + |
| 109 | + public System.Threading.Tasks.Task<double> SubtractAsync(double n1, double n2) |
| 110 | + { |
| 111 | + return base.Channel.SubtractAsync(n1, n2); |
| 112 | + } |
| 113 | + |
| 114 | + public double Multiply(double n1, double n2) |
| 115 | + { |
| 116 | + return base.Channel.Multiply(n1, n2); |
| 117 | + } |
| 118 | + |
| 119 | + public System.Threading.Tasks.Task<double> MultiplyAsync(double n1, double n2) |
| 120 | + { |
| 121 | + return base.Channel.MultiplyAsync(n1, n2); |
| 122 | + } |
| 123 | + |
| 124 | + public double Divide(double n1, double n2) |
| 125 | + { |
| 126 | + return base.Channel.Divide(n1, n2); |
| 127 | + } |
| 128 | + |
| 129 | + public System.Threading.Tasks.Task<double> DivideAsync(double n1, double n2) |
| 130 | + { |
| 131 | + return base.Channel.DivideAsync(n1, n2); |
| 132 | + } |
| 133 | + |
| 134 | + public virtual System.Threading.Tasks.Task OpenAsync() |
| 135 | + { |
| 136 | + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); |
| 137 | + } |
| 138 | + |
| 139 | + public virtual System.Threading.Tasks.Task CloseAsync() |
| 140 | + { |
| 141 | + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); |
| 142 | + } |
| 143 | + |
| 144 | + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) |
| 145 | + { |
| 146 | + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_ICalculatorService)) |
| 147 | + { |
| 148 | + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); |
| 149 | + result.MaxBufferSize = int.MaxValue; |
| 150 | + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; |
| 151 | + result.MaxReceivedMessageSize = int.MaxValue; |
| 152 | + result.AllowCookies = true; |
| 153 | + result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport; |
| 154 | + return result; |
| 155 | + } |
| 156 | + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); |
| 157 | + } |
| 158 | + |
| 159 | + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) |
| 160 | + { |
| 161 | + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_ICalculatorService)) |
| 162 | + { |
| 163 | + return new System.ServiceModel.EndpointAddress("https://localhost/CoreWcfSamples/basicHttpTransportSecurity/CalculatorService/basicHttpTransportSecurity"); |
| 164 | + } |
| 165 | + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); |
| 166 | + } |
| 167 | + |
| 168 | + private static System.ServiceModel.Channels.Binding GetDefaultBinding() |
| 169 | + { |
| 170 | + return CalculatorServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_ICalculatorService); |
| 171 | + } |
| 172 | + |
| 173 | + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() |
| 174 | + { |
| 175 | + return CalculatorServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_ICalculatorService); |
| 176 | + } |
| 177 | + |
| 178 | + public enum EndpointConfiguration |
| 179 | + { |
| 180 | + |
| 181 | + BasicHttpBinding_ICalculatorService, |
| 182 | + } |
| 183 | + } |
| 184 | +} |
0 commit comments