Exemple #1
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.KPSPublicSoap))
     {
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         result.Security.Mode          = System.ServiceModel.BasicHttpSecurityMode.Transport;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.KPSPublicSoap12))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
         httpsBindingElement.AllowCookies           = true;
         httpsBindingElement.MaxBufferSize          = int.MaxValue;
         httpsBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpsBindingElement);
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("\'{0}\' adlı uç nokta bulunamadı.", endpointConfiguration));
 }
Exemple #2
0
        private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
        {
            switch (endpointConfiguration)
            {
            case EndpointConfiguration.ReportExecutionServiceSoap:
            {
                System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
                result.MaxBufferSize          = 2147483647;
                result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
                result.MaxReceivedMessageSize = 2147483647L;
                result.AllowCookies           = true;
                return(result);
            }

            case EndpointConfiguration.ReportExecutionServiceSoap12:
            {
                System.ServiceModel.Channels.CustomBinding result2 = new System.ServiceModel.Channels.CustomBinding();
                System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
                textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
                result2.Elements.Add(textBindingElement);
                System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
                httpBindingElement.AllowCookies           = true;
                httpBindingElement.MaxBufferSize          = 2147483647;
                httpBindingElement.MaxReceivedMessageSize = 2147483647L;
                httpBindingElement.AuthenticationScheme   = System.Net.AuthenticationSchemes.Ntlm;
                result2.Elements.Add(httpBindingElement);
                return(result2);
            }

            default:
                throw new System.InvalidOperationException($"Could not find endpoint with name '{endpointConfiguration}'.");
            }
        }
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.DelayedStockQuoteSoap))
     {
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.DelayedStockQuoteSoap12))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
 }
Exemple #4
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.WSHttpBinding_ISettings))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
         httpsBindingElement.AllowCookies           = true;
         httpsBindingElement.MaxBufferSize          = int.MaxValue;
         httpsBindingElement.MaxReceivedMessageSize = int.MaxValue;
         httpsBindingElement.AuthenticationScheme   = System.Net.AuthenticationSchemes.Negotiate;
         result.Elements.Add(httpsBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_ISettings))
     {
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         result.Security.Mode          = System.ServiceModel.BasicHttpSecurityMode.Transport;
         result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Windows;
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
 }
Exemple #5
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.ServicePXSoap))
     {
         //System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly);
         result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Basic;
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.ServicePXSoap12))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("No se pudo encontrar un punto de conexión con el nombre \"{0}\".", endpointConfiguration));
 }
Exemple #6
0
        private System.ServiceModel.Channels.Binding CreateBindingForEndpoint(GatewayBindings binding)
        {
            if (binding == GatewayBindings.basicHttpsBinding)
            {
                System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding
                {
                    MaxBufferSize          = int.MaxValue,
                    ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max,
                    MaxReceivedMessageSize = int.MaxValue,
                    AllowCookies           = true
                };
                return(result);
            }

            if (binding == GatewayBindings.wsHttpBinding)
            {
                System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
                System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
                result.Elements.Add(textBindingElement);

                System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement
                {
                    AllowCookies           = true,
                    MaxBufferSize          = int.MaxValue,
                    MaxReceivedMessageSize = int.MaxValue
                };
                result.Elements.Add(httpsBindingElement);

                return(result);
            }

            throw new InvalidOperationException(string.Format("Could not find endpoint configurations - \'{0}\'.", binding.ToString()));
        }
 protected System.ServiceModel.Channels.Binding CreateBinding()
 {
     System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
     System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
     textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap11, System.ServiceModel.Channels.AddressingVersion.None);
     result.Elements.Add(textBindingElement);
     if (this.ReportSettings.IsSSL)
     {
         System.ServiceModel.Channels.HttpsTransportBindingElement httpBindingElement2 = new System.ServiceModel.Channels.HttpsTransportBindingElement();
         httpBindingElement2.AllowCookies           = true;
         httpBindingElement2.MaxBufferSize          = 2147483647;
         httpBindingElement2.MaxReceivedMessageSize = 2147483647L;
         httpBindingElement2.AuthenticationScheme   = System.Net.AuthenticationSchemes.Ntlm;
         result.Elements.Add(httpBindingElement2);
     }
     else
     {
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = 2147483647;
         httpBindingElement.MaxReceivedMessageSize = 2147483647L;
         httpBindingElement.AuthenticationScheme   = System.Net.AuthenticationSchemes.Ntlm;
         result.Elements.Add(httpBindingElement);
     }
     return(result);
 }
Exemple #8
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.WSHttpBinding_IMFUploadService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.WSHttpBinding_IMFUploadService1))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
         httpsBindingElement.AllowCookies           = true;
         httpsBindingElement.MaxBufferSize          = int.MaxValue;
         httpsBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpsBindingElement);
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
 }
Exemple #9
0
        internal static System.ServiceModel.Channels.Message DeserialzieMessageFromStream(MemoryStream ms, System.ServiceModel.Channels.MessageVersion messageVersion)
        {
            var tmebe = new System.ServiceModel.Channels.TextMessageEncodingBindingElement
            {
                MessageVersion = messageVersion,
                ReaderQuotas   = XmlDictionaryReaderQuotas.Max
            };

            System.ServiceModel.Channels.MessageEncoderFactory tmef = tmebe.CreateMessageEncoderFactory();
            return(tmef.Encoder.ReadMessage(ms, int.MaxValue));
        }
Exemple #10
0
        private static MemoryStream SerializeMessageToStream(System.ServiceModel.Channels.Message requestMessage)
        {
            var tmebe = new System.ServiceModel.Channels.TextMessageEncodingBindingElement
            {
                MessageVersion = requestMessage.Version,
                ReaderQuotas   = XmlDictionaryReaderQuotas.Max
            };

            System.ServiceModel.Channels.MessageEncoderFactory tmef = tmebe.CreateMessageEncoderFactory();
            var ms = new MemoryStream(64 * 1024); // 64K to keep out of LOH

            tmef.Encoder.WriteMessage(requestMessage, ms);
            ms.Position = 0;
            return(ms);
        }
Exemple #11
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.Pagos))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("No se pudo encontrar un punto de conexión con el nombre \"{0}\".", endpointConfiguration));
 }
Exemple #12
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.LDC_API_processPaymentOrder_v1_soap_ws_Port))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
         httpsBindingElement.AllowCookies           = true;
         httpsBindingElement.MaxBufferSize          = int.MaxValue;
         httpsBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpsBindingElement);
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
 }
Exemple #13
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.WSHttpBinding_IInsuranceInquiry))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TransportSecurityBindingElement userNameOverTransportSecurityBindingElement = System.ServiceModel.Channels.SecurityBindingElement.CreateUserNameOverTransportBindingElement();
         userNameOverTransportSecurityBindingElement.MessageSecurityVersion = System.ServiceModel.MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10;
         result.Elements.Add(userNameOverTransportSecurityBindingElement);
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
         httpsBindingElement.AllowCookies           = true;
         httpsBindingElement.MaxBufferSize          = int.MaxValue;
         httpsBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpsBindingElement);
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
 }
Exemple #14
0
        public override System.ServiceModel.Channels.BindingElementCollection CreateBindingElements()
        {
            System.ServiceModel.Channels.BindingElement tx = new System.ServiceModel.Channels.TransactionFlowBindingElement(System.ServiceModel.TransactionProtocol.WSAtomicTransactionOctober2004);
            var sec = CreateMessageSecurity();

            System.ServiceModel.Channels.BindingElement msg = null;
            var msgver = System.ServiceModel.Channels.MessageVersion.CreateVersion(EnvelopeVersion, System.ServiceModel.Channels.AddressingVersion.WSAddressing10);

            switch (MessageEncoding)
            {
            case System.ServiceModel.WSMessageEncoding.Mtom:
                msg = new System.ServiceModel.Channels.MtomMessageEncodingBindingElement(msgver, TextEncoding);
                break;

            case System.ServiceModel.WSMessageEncoding.Text:
                msg = new System.ServiceModel.Channels.TextMessageEncodingBindingElement(msgver, TextEncoding);
                break;

            default:
                throw new NotImplementedException("mhm, another WSMessageEncoding?");
            }
            var tr   = GetTransport();
            var list = new List <System.ServiceModel.Channels.BindingElement>();

            list.Add(tx);
            if (sec != null)
            {
                list.Add(sec);
            }
            list.Add(msg);
            if (tr != null)
            {
                list.Add(tr);
            }
            return(new System.ServiceModel.Channels.BindingElementCollection(list.ToArray()));
        }
Exemple #15
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.defaultEndpoint))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.defaultBasic))
     {
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.basicHttpEndpoint))
     {
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.basicHttpsEndpoint))
     {
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         result.Security.Mode          = System.ServiceModel.BasicHttpSecurityMode.Transport;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.httpsoap11Endpoint))
     {
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.httpsoap12Endpoint))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         result.Elements.Add(new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement());
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.httpssoap11Endpoint))
     {
         System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.AllowCookies           = true;
         result.Security.Mode          = System.ServiceModel.BasicHttpSecurityMode.Transport;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.httpssoap12Endpoint))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
         httpsBindingElement.AllowCookies           = true;
         httpsBindingElement.MaxBufferSize          = int.MaxValue;
         httpsBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpsBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding))
     {
         System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding1))
     {
         System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding();
         result.MaxBufferSize          = int.MaxValue;
         result.ReaderQuotas           = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize = int.MaxValue;
         result.Security.Mode          = System.ServiceModel.SecurityMode.None;
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
 }
Exemple #16
0
 private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
 {
     if ((endpointConfiguration == EndpointConfiguration.NetHttpOrdered_WSReliableMessaging11_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         reliableBindingElement.ReliableMessagingVersion = System.ServiceModel.ReliableMessagingVersion.WSReliableMessaging11;
         result.Elements.Add(reliableBindingElement);
         result.Elements.Add(new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement());
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.NetHttpUnordered_WSReliableMessaging11_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         reliableBindingElement.Ordered = false;
         reliableBindingElement.ReliableMessagingVersion = System.ServiceModel.ReliableMessagingVersion.WSReliableMessaging11;
         result.Elements.Add(reliableBindingElement);
         result.Elements.Add(new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement());
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.NetHttpOrdered_WSReliableMessagingFebruary2005_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         result.Elements.Add(reliableBindingElement);
         result.Elements.Add(new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement());
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.NetHttpUnordered_WSReliableMessagingFebruary2005_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         result.Elements.Add(reliableBindingElement);
         result.Elements.Add(new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement());
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.NetTcpOrdered_WSReliableMessaging11_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         reliableBindingElement.ReliableMessagingVersion = System.ServiceModel.ReliableMessagingVersion.WSReliableMessaging11;
         result.Elements.Add(reliableBindingElement);
         result.Elements.Add(new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement());
         System.ServiceModel.Channels.TcpTransportBindingElement tcpBindingElement = new System.ServiceModel.Channels.TcpTransportBindingElement();
         tcpBindingElement.MaxBufferSize          = int.MaxValue;
         tcpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(tcpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.NetTcpUnordered_WSReliableMessaging11_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         reliableBindingElement.Ordered = false;
         reliableBindingElement.ReliableMessagingVersion = System.ServiceModel.ReliableMessagingVersion.WSReliableMessaging11;
         result.Elements.Add(reliableBindingElement);
         result.Elements.Add(new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement());
         System.ServiceModel.Channels.TcpTransportBindingElement tcpBindingElement = new System.ServiceModel.Channels.TcpTransportBindingElement();
         tcpBindingElement.MaxBufferSize          = int.MaxValue;
         tcpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(tcpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.NetTcpOrdered_WSReliableMessagingFebruary2005_IWcfReliableService))
     {
         System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding();
         result.MaxBufferSize           = int.MaxValue;
         result.ReaderQuotas            = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize  = int.MaxValue;
         result.Security.Mode           = System.ServiceModel.SecurityMode.None;
         result.ReliableSession.Enabled = true;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.NetTcpUnordered_WSReliableMessagingFebruary2005_IWcfReliableService))
     {
         System.ServiceModel.NetTcpBinding result = new System.ServiceModel.NetTcpBinding();
         result.MaxBufferSize           = int.MaxValue;
         result.ReaderQuotas            = System.Xml.XmlDictionaryReaderQuotas.Max;
         result.MaxReceivedMessageSize  = int.MaxValue;
         result.Security.Mode           = System.ServiceModel.SecurityMode.None;
         result.ReliableSession.Enabled = true;
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.WSHttpOrdered_WSReliableMessaging11_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         reliableBindingElement.ReliableMessagingVersion = System.ServiceModel.ReliableMessagingVersion.WSReliableMessaging11;
         result.Elements.Add(reliableBindingElement);
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.WSHttpUnordered_WSReliableMessaging11_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         reliableBindingElement.Ordered = false;
         reliableBindingElement.ReliableMessagingVersion = System.ServiceModel.ReliableMessagingVersion.WSReliableMessaging11;
         result.Elements.Add(reliableBindingElement);
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.WSHttpOrdered_WSReliableMessagingFebruary2005_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         result.Elements.Add(reliableBindingElement);
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     if ((endpointConfiguration == EndpointConfiguration.WSHttpUnordered_WSReliableMessagingFebruary2005_IWcfReliableService))
     {
         System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
         System.ServiceModel.Channels.ReliableSessionBindingElement reliableBindingElement = new System.ServiceModel.Channels.ReliableSessionBindingElement();
         result.Elements.Add(reliableBindingElement);
         System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
         result.Elements.Add(textBindingElement);
         System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement();
         httpBindingElement.AllowCookies           = true;
         httpBindingElement.MaxBufferSize          = int.MaxValue;
         httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
         result.Elements.Add(httpBindingElement);
         return(result);
     }
     throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
 }