|
| 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 MTPS |
| 11 | +{ |
| 12 | + |
| 13 | + |
| 14 | + [System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.0.0")] |
| 15 | + [System.ServiceModel.ServiceContractAttribute(Namespace="urn:msdn-com:public-content-syndication", ConfigurationName="MTPS.ContentServicePortType")] |
| 16 | + internal partial interface ContentServicePortType |
| 17 | + { |
| 18 | + } |
| 19 | + |
| 20 | + [System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.0.0")] |
| 21 | + internal interface ContentServicePortTypeChannel : MTPS.ContentServicePortType, System.ServiceModel.IClientChannel |
| 22 | + { |
| 23 | + } |
| 24 | + |
| 25 | + [System.Diagnostics.DebuggerStepThroughAttribute()] |
| 26 | + [System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.0.0")] |
| 27 | + internal partial class ContentServicePortTypeClient : System.ServiceModel.ClientBase<MTPS.ContentServicePortType>, MTPS.ContentServicePortType |
| 28 | + { |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// Implement this partial method to configure the service endpoint. |
| 32 | + /// </summary> |
| 33 | + /// <param name="serviceEndpoint">The endpoint to configure</param> |
| 34 | + /// <param name="clientCredentials">The client credentials</param> |
| 35 | + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); |
| 36 | + |
| 37 | + public ContentServicePortTypeClient(EndpointConfiguration endpointConfiguration) : |
| 38 | + base(ContentServicePortTypeClient.GetBindingForEndpoint(endpointConfiguration), ContentServicePortTypeClient.GetEndpointAddress(endpointConfiguration)) |
| 39 | + { |
| 40 | + this.Endpoint.Name = endpointConfiguration.ToString(); |
| 41 | + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); |
| 42 | + } |
| 43 | + |
| 44 | + public ContentServicePortTypeClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : |
| 45 | + base(ContentServicePortTypeClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) |
| 46 | + { |
| 47 | + this.Endpoint.Name = endpointConfiguration.ToString(); |
| 48 | + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); |
| 49 | + } |
| 50 | + |
| 51 | + public ContentServicePortTypeClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : |
| 52 | + base(ContentServicePortTypeClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) |
| 53 | + { |
| 54 | + this.Endpoint.Name = endpointConfiguration.ToString(); |
| 55 | + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); |
| 56 | + } |
| 57 | + |
| 58 | + public ContentServicePortTypeClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : |
| 59 | + base(binding, remoteAddress) |
| 60 | + { |
| 61 | + } |
| 62 | + |
| 63 | + public virtual System.Threading.Tasks.Task OpenAsync() |
| 64 | + { |
| 65 | + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); |
| 66 | + } |
| 67 | + |
| 68 | + public virtual System.Threading.Tasks.Task CloseAsync() |
| 69 | + { |
| 70 | + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); |
| 71 | + } |
| 72 | + |
| 73 | + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) |
| 74 | + { |
| 75 | + if ((endpointConfiguration == EndpointConfiguration.ContentService)) |
| 76 | + { |
| 77 | + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); |
| 78 | + result.MaxBufferSize = int.MaxValue; |
| 79 | + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; |
| 80 | + result.MaxReceivedMessageSize = int.MaxValue; |
| 81 | + result.AllowCookies = true; |
| 82 | + return result; |
| 83 | + } |
| 84 | + if ((endpointConfiguration == EndpointConfiguration.ContentService12)) |
| 85 | + { |
| 86 | + System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding(); |
| 87 | + System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement(); |
| 88 | + textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None); |
| 89 | + result.Elements.Add(textBindingElement); |
| 90 | + System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement(); |
| 91 | + httpBindingElement.AllowCookies = true; |
| 92 | + httpBindingElement.MaxBufferSize = int.MaxValue; |
| 93 | + httpBindingElement.MaxReceivedMessageSize = int.MaxValue; |
| 94 | + result.Elements.Add(httpBindingElement); |
| 95 | + return result; |
| 96 | + } |
| 97 | + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); |
| 98 | + } |
| 99 | + |
| 100 | + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) |
| 101 | + { |
| 102 | + if ((endpointConfiguration == EndpointConfiguration.ContentService)) |
| 103 | + { |
| 104 | + return new System.ServiceModel.EndpointAddress("http://services.msdn.microsoft.com/ContentServices/ContentService.asmx"); |
| 105 | + } |
| 106 | + if ((endpointConfiguration == EndpointConfiguration.ContentService12)) |
| 107 | + { |
| 108 | + return new System.ServiceModel.EndpointAddress("http://services.msdn.microsoft.com/ContentServices/ContentService.asmx"); |
| 109 | + } |
| 110 | + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); |
| 111 | + } |
| 112 | + |
| 113 | + public enum EndpointConfiguration |
| 114 | + { |
| 115 | + |
| 116 | + ContentService, |
| 117 | + |
| 118 | + ContentService12, |
| 119 | + } |
| 120 | + } |
| 121 | +} |
0 commit comments