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