diff --git a/src/dotnet-svcutil/lib/src/CodeDomFixup/EndpointSelector.cs b/src/dotnet-svcutil/lib/src/CodeDomFixup/EndpointSelector.cs index 3ab4170fe0..2e09ff021b 100644 --- a/src/dotnet-svcutil/lib/src/CodeDomFixup/EndpointSelector.cs +++ b/src/dotnet-svcutil/lib/src/CodeDomFixup/EndpointSelector.cs @@ -247,7 +247,8 @@ private static void ValidateUserNamePasswordSecurityBindingElement(TransportSecu if (transportSecurityBindingElement.MessageSecurityVersion != MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10 && transportSecurityBindingElement.MessageSecurityVersion != MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10 && - transportSecurityBindingElement.MessageSecurityVersion != MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11) + transportSecurityBindingElement.MessageSecurityVersion != MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11 && + transportSecurityBindingElement.MessageSecurityVersion != MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10) { string values = string.Format(CultureInfo.InvariantCulture, "'{0}', '{1}', '{2}'", MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10, diff --git a/src/dotnet-svcutil/lib/src/CodeDomFixup/MethodCreationHelper.cs b/src/dotnet-svcutil/lib/src/CodeDomFixup/MethodCreationHelper.cs index 3eaa69665d..b81677ad94 100644 --- a/src/dotnet-svcutil/lib/src/CodeDomFixup/MethodCreationHelper.cs +++ b/src/dotnet-svcutil/lib/src/CodeDomFixup/MethodCreationHelper.cs @@ -175,16 +175,269 @@ private static void AddBindingConfiguration(CodeStatementCollection statements, return; } - WSHttpBinding httpBinding = binding as WSHttpBinding; - if (httpBinding != null) + if (binding is WS2007HttpBinding ws2007HttpBinding) { - AddCustomBindingConfiguration(statements, new CustomBinding(httpBinding)); + AddWS2007HttpBindingConfiguration(statements, ws2007HttpBinding); + return; + } + + if (binding is WSHttpBinding wsHttpBinding) + { + AddWSHttpBindingConfiguration(statements, wsHttpBinding); return; } throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.ErrBindingTypeNotSupportedFormat, binding.GetType().FullName)); } + private static void AddWSHttpBindingConfiguration(CodeStatementCollection statements, WSHttpBinding wsHttp) + { + const string ResultVarName = "result"; + WSHttpBinding defaultBinding = new WSHttpBinding(); + + statements.Add( + new CodeVariableDeclarationStatement( + typeof(WSHttpBinding), + ResultVarName, + new CodeObjectCreateExpression(typeof(WSHttpBinding)))); + CodeVariableReferenceExpression resultVar = new CodeVariableReferenceExpression(ResultVarName); + + WSHttpMaxOutProperties(statements, resultVar); + + // Set AllowCookies's default value to true. + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + resultVar, + "AllowCookies"), + new CodePrimitiveExpression(true))); + + if (defaultBinding.MessageEncoding != wsHttp.MessageEncoding) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + resultVar, + "MessageEncoding"), + new CodePropertyReferenceExpression( + new CodeTypeReferenceExpression(typeof(WSMessageEncoding)), + wsHttp.MessageEncoding.ToString()))); + } + + if (defaultBinding.TransactionFlow != wsHttp.TransactionFlow) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + resultVar, + "TransactionFlow"), + new CodePrimitiveExpression(wsHttp.TransactionFlow))); + } + + if (defaultBinding.ReliableSession.Enabled != wsHttp.ReliableSession.Enabled) + { + if (wsHttp.ReliableSession.Enabled) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "ReliableSession"), + "Enabled"), + new CodePrimitiveExpression(wsHttp.ReliableSession.Enabled))); + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "ReliableSession"), + "Ordered"), + new CodePrimitiveExpression(wsHttp.ReliableSession.Ordered))); + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "ReliableSession"), + "InactivityTimeout"), + CreateTimeSpanExpression(wsHttp.ReliableSession.InactivityTimeout))); + } + } + + if (defaultBinding.Security.Mode != wsHttp.Security.Mode) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "Security"), + "Mode"), + new CodeFieldReferenceExpression( + new CodeTypeReferenceExpression(typeof(SecurityMode)), + wsHttp.Security.Mode.ToString()))); + } + + if (defaultBinding.Security.Transport.ClientCredentialType != wsHttp.Security.Transport.ClientCredentialType) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "Security"), + "Transport"), + "ClientCredentialType"), + new CodeFieldReferenceExpression( + new CodeTypeReferenceExpression(typeof(HttpClientCredentialType)), + wsHttp.Security.Transport.ClientCredentialType.ToString()))); + } + + if (defaultBinding.Security.Message.ClientCredentialType != wsHttp.Security.Message.ClientCredentialType) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "Security"), + "Message"), + "ClientCredentialType"), + new CodeFieldReferenceExpression( + new CodeTypeReferenceExpression(typeof(MessageCredentialType)), + wsHttp.Security.Message.ClientCredentialType.ToString()))); + } + + if (defaultBinding.Security.Message.EstablishSecurityContext != wsHttp.Security.Message.EstablishSecurityContext) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "Security"), + "Message"), + "EstablishSecurityContext"), + new CodePrimitiveExpression(wsHttp.Security.Message.EstablishSecurityContext))); + } + + statements.Add(new CodeMethodReturnStatement(resultVar)); + } + + private static void AddWS2007HttpBindingConfiguration(CodeStatementCollection statements, WS2007HttpBinding ws2007Http) + { + const string ResultVarName = "result"; + WS2007HttpBinding defaultBinding = new WS2007HttpBinding(); + + statements.Add( + new CodeVariableDeclarationStatement( + typeof(WS2007HttpBinding), + ResultVarName, + new CodeObjectCreateExpression(typeof(WS2007HttpBinding)))); + CodeVariableReferenceExpression resultVar = new CodeVariableReferenceExpression(ResultVarName); + + WSHttpMaxOutProperties(statements, resultVar); + + // Set AllowCookies's default value to true. + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + resultVar, + "AllowCookies"), + new CodePrimitiveExpression(true))); + + if (defaultBinding.MessageEncoding != ws2007Http.MessageEncoding) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + resultVar, + "MessageEncoding"), + new CodePropertyReferenceExpression( + new CodeTypeReferenceExpression(typeof(WSMessageEncoding)), + ws2007Http.MessageEncoding.ToString()))); + } + + if (defaultBinding.TransactionFlow != ws2007Http.TransactionFlow) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + resultVar, + "TransactionFlow"), + new CodePrimitiveExpression(ws2007Http.TransactionFlow))); + } + + if (defaultBinding.ReliableSession.Enabled != ws2007Http.ReliableSession.Enabled) + { + if (ws2007Http.ReliableSession.Enabled) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "ReliableSession"), + "Enabled"), + new CodePrimitiveExpression(ws2007Http.ReliableSession.Enabled))); + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "ReliableSession"), + "Ordered"), + new CodePrimitiveExpression(ws2007Http.ReliableSession.Ordered))); + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "ReliableSession"), + "InactivityTimeout"), + CreateTimeSpanExpression(ws2007Http.ReliableSession.InactivityTimeout))); + } + } + + if (defaultBinding.Security.Mode != ws2007Http.Security.Mode) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "Security"), + "Mode"), + new CodeFieldReferenceExpression( + new CodeTypeReferenceExpression(typeof(SecurityMode)), + ws2007Http.Security.Mode.ToString()))); + } + + if (defaultBinding.Security.Transport.ClientCredentialType != ws2007Http.Security.Transport.ClientCredentialType) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "Security"), + "Transport"), + "ClientCredentialType"), + new CodeFieldReferenceExpression( + new CodeTypeReferenceExpression(typeof(HttpClientCredentialType)), + ws2007Http.Security.Transport.ClientCredentialType.ToString()))); + } + + if (defaultBinding.Security.Message.ClientCredentialType != ws2007Http.Security.Message.ClientCredentialType) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "Security"), + "Message"), + "ClientCredentialType"), + new CodeFieldReferenceExpression( + new CodeTypeReferenceExpression(typeof(MessageCredentialType)), + ws2007Http.Security.Message.ClientCredentialType.ToString()))); + } + + if (defaultBinding.Security.Message.EstablishSecurityContext != ws2007Http.Security.Message.EstablishSecurityContext) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression( + new CodePropertyReferenceExpression(resultVar, "Security"), + "Message"), + "EstablishSecurityContext"), + new CodePrimitiveExpression(ws2007Http.Security.Message.EstablishSecurityContext))); + } + + statements.Add(new CodeMethodReturnStatement(resultVar)); + } + private static void AddCustomBindingConfiguration(CodeStatementCollection statements, CustomBinding custom) { const string ResultVarName = "result"; @@ -1054,6 +1307,23 @@ private static void MaxOutProperties(CodeStatementCollection statements, CodeVar new CodePropertyReferenceExpression(new CodeTypeReferenceExpression(typeof(int)), "MaxValue"))); } + private static void WSHttpMaxOutProperties(CodeStatementCollection statements, CodeVariableReferenceExpression resultVar) + { + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + resultVar, + "ReaderQuotas"), + new CodePropertyReferenceExpression(new CodeTypeReferenceExpression(typeof(XmlDictionaryReaderQuotas)), "Max"))); + + statements.Add( + new CodeAssignStatement( + new CodePropertyReferenceExpression( + resultVar, + "MaxReceivedMessageSize"), + new CodePropertyReferenceExpression(new CodeTypeReferenceExpression(typeof(int)), "MaxValue"))); + } + private void AddNewEndpointAddress(string endpointConfigurationName, string endpointAddress, ServiceEndpoint serviceEndpoint) { CodeExpression createIdentityExpression = null; diff --git a/src/dotnet-svcutil/lib/src/FrameworkFork/System.ServiceModel/System/ServiceModel/ReliableSession.cs b/src/dotnet-svcutil/lib/src/FrameworkFork/System.ServiceModel/System/ServiceModel/ReliableSession.cs index 67fe787fc6..2b9f246010 100644 --- a/src/dotnet-svcutil/lib/src/FrameworkFork/System.ServiceModel/System/ServiceModel/ReliableSession.cs +++ b/src/dotnet-svcutil/lib/src/FrameworkFork/System.ServiceModel/System/ServiceModel/ReliableSession.cs @@ -27,6 +27,31 @@ public ReliableSession(ReliableSessionBindingElement reliableSessionBindingEleme throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reliableSessionBindingElement"); _element = reliableSessionBindingElement; } + + public bool Ordered + { + get { return _element.Ordered; } + set { _element.Ordered = value; } + } + + public TimeSpan InactivityTimeout + { + get { return _element.InactivityTimeout; } + set + { + if (value <= TimeSpan.Zero) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(value), value, + SRServiceModel.ValueMustBePositive)); + + _element.InactivityTimeout = value; + } + } + + internal void CopySettings(ReliableSession copyFrom) + { + Ordered = copyFrom.Ordered; + InactivityTimeout = copyFrom.InactivityTimeout; + } } public class OptionalReliableSession : ReliableSession diff --git a/src/dotnet-svcutil/lib/src/FrameworkFork/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy12.cs b/src/dotnet-svcutil/lib/src/FrameworkFork/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy12.cs index b77f37c58d..ccfe203a3f 100644 --- a/src/dotnet-svcutil/lib/src/FrameworkFork/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy12.cs +++ b/src/dotnet-svcutil/lib/src/FrameworkFork/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy12.cs @@ -44,9 +44,7 @@ public override TrustDriver TrustDriver { get { - throw new NotImplementedException(); - // TODO: - // return new WSTrustDec2005.DriverDec2005(new SecurityStandardsManager(MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12, WSSecurityTokenSerializer.DefaultInstance)); + return new WSTrustDec2005.DriverDec2005(new SecurityStandardsManager(MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12, WSSecurityTokenSerializer.DefaultInstance)); } } @@ -157,6 +155,55 @@ public override Collection CreateWsspSupportingTokensAssertion(Metad return supportingTokenAssertions; } + public override XmlElement CreateWsspSpnegoContextTokenAssertion(MetadataExporter exporter, SspiSecurityTokenParameters parameters) + { + XmlElement result = CreateWsspAssertion(SpnegoContextTokenName); + SetIncludeTokenValue(result, parameters.InclusionMode); + result.AppendChild( + CreateWspPolicyWrapper( + exporter, + CreateWsspRequireDerivedKeysAssertion(parameters.RequireDerivedKeys), + // Always emit for spnego and sslnego + CreateWsspMustNotSendCancelAssertion(false), + CreateWsspMustNotSendAmendAssertion(), + CreateWsspMustNotSendRenewAssertion() + )); + return result; + } + + public override XmlElement CreateMsspSslContextTokenAssertion(MetadataExporter exporter, SslSecurityTokenParameters parameters) + { + XmlElement result = CreateMsspAssertion(SslContextTokenName); + SetIncludeTokenValue(result, parameters.InclusionMode); + result.AppendChild( + CreateWspPolicyWrapper( + exporter, + CreateWsspRequireDerivedKeysAssertion(parameters.RequireDerivedKeys), + // Always emit for spnego and sslnego + CreateWsspMustNotSendCancelAssertion(false), + CreateMsspRequireClientCertificateAssertion(parameters.RequireClientCertificate), + CreateWsspMustNotSendAmendAssertion(), + CreateWsspMustNotSendRenewAssertion() + )); + return result; + } + + public override XmlElement CreateWsspSecureConversationTokenAssertion(MetadataExporter exporter, SecureConversationSecurityTokenParameters parameters) + { + XmlElement result = CreateWsspAssertion(SecureConversationTokenName); + SetIncludeTokenValue(result, parameters.InclusionMode); + result.AppendChild( + CreateWspPolicyWrapper( + exporter, + CreateWsspRequireDerivedKeysAssertion(parameters.RequireDerivedKeys), + CreateWsspMustNotSendCancelAssertion(parameters.RequireCancellation), + CreateWsspBootstrapPolicyAssertion(exporter, parameters.BootstrapSecurityBindingElement), + CreateWsspMustNotSendAmendAssertion(), + (!parameters.RequireCancellation || !parameters.CanRenewSession) ? CreateWsspMustNotSendRenewAssertion() : null + )); + return result; + } + private XmlElement CreateWsspMustNotSendAmendAssertion() { XmlElement result = CreateWsspAssertion(MustNotSendAmendName); @@ -169,6 +216,152 @@ private XmlElement CreateWsspMustNotSendRenewAssertion() return result; } + public override bool TryImportWsspSpnegoContextTokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters) + { + parameters = null; + + SecurityTokenInclusionMode inclusionMode; + Collection> alternatives; + + if (IsWsspAssertion(assertion, SpnegoContextTokenName) + && TryGetIncludeTokenValue(assertion, out inclusionMode)) + { + if (TryGetNestedPolicyAlternatives(importer, assertion, out alternatives)) + { + foreach (Collection alternative in alternatives) + { + SspiSecurityTokenParameters sspi = new SspiSecurityTokenParameters(); + parameters = sspi; + bool requireCancellation; + bool canRenewSession; + if (TryImportWsspRequireDerivedKeysAssertion(alternative, sspi) + && TryImportWsspMustNotSendCancelAssertion(alternative, out requireCancellation) + && TryImportWsspMustNotSendAmendAssertion(alternative) + // We do not support Renew for spnego and sslnego. Read the + // assertion if present and ignore it. + && TryImportWsspMustNotSendRenewAssertion(alternative, out canRenewSession) + && alternative.Count == 0) + { + // Client always set this to true to match the standardbinding. + // This setting on client has no effect for spnego and sslnego. + sspi.RequireCancellation = true; + sspi.InclusionMode = inclusionMode; + break; + } + else + { + parameters = null; + } + } + } + else + { + parameters = new SspiSecurityTokenParameters(); + parameters.RequireDerivedKeys = false; + parameters.InclusionMode = inclusionMode; + } + } + + return parameters != null; + } + + public override bool TryImportMsspSslContextTokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters) + { + parameters = null; + + SecurityTokenInclusionMode inclusionMode; + Collection> alternatives; + + if (IsMsspAssertion(assertion, SslContextTokenName) + && TryGetIncludeTokenValue(assertion, out inclusionMode)) + { + if (TryGetNestedPolicyAlternatives(importer, assertion, out alternatives)) + { + foreach (Collection alternative in alternatives) + { + SslSecurityTokenParameters ssl = new SslSecurityTokenParameters(); + parameters = ssl; + bool requireCancellation; + bool canRenewSession; + if (TryImportWsspRequireDerivedKeysAssertion(alternative, ssl) + && TryImportWsspMustNotSendCancelAssertion(alternative, out requireCancellation) + && TryImportWsspMustNotSendAmendAssertion(alternative) + // We do not support Renew for spnego and sslnego. Read the + // assertion if present and ignore it. + && TryImportWsspMustNotSendRenewAssertion(alternative, out canRenewSession) + && TryImportMsspRequireClientCertificateAssertion(alternative, ssl) + && alternative.Count == 0) + { + // Client always set this to true to match the standardbinding. + // This setting on client has no effect for spnego and sslnego. + ssl.RequireCancellation = true; + ssl.InclusionMode = inclusionMode; + break; + } + else + { + parameters = null; + } + } + } + else + { + parameters = new SslSecurityTokenParameters(); + parameters.RequireDerivedKeys = false; + parameters.InclusionMode = inclusionMode; + } + } + + return parameters != null; + } + + public override bool TryImportWsspSecureConversationTokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters) + { + parameters = null; + + SecurityTokenInclusionMode inclusionMode; + Collection> alternatives; + + if (IsWsspAssertion(assertion, SecureConversationTokenName) + && TryGetIncludeTokenValue(assertion, out inclusionMode)) + { + if (TryGetNestedPolicyAlternatives(importer, assertion, out alternatives)) + { + foreach (Collection alternative in alternatives) + { + SecureConversationSecurityTokenParameters sc = new SecureConversationSecurityTokenParameters(); + parameters = sc; + bool requireCancellation; + bool canRenewSession; + if (TryImportWsspRequireDerivedKeysAssertion(alternative, sc) + && TryImportWsspMustNotSendCancelAssertion(alternative, out requireCancellation) + && TryImportWsspMustNotSendAmendAssertion(alternative) + && TryImportWsspMustNotSendRenewAssertion(alternative, out canRenewSession) + && TryImportWsspBootstrapPolicyAssertion(importer, alternative, sc) + && alternative.Count == 0) + { + sc.RequireCancellation = requireCancellation; + sc.CanRenewSession = canRenewSession; + sc.InclusionMode = inclusionMode; + break; + } + else + { + parameters = null; + } + } + } + else + { + parameters = new SecureConversationSecurityTokenParameters(); + parameters.InclusionMode = inclusionMode; + parameters.RequireDerivedKeys = false; + } + } + + return parameters != null; + } + public virtual bool TryImportWsspMustNotSendAmendAssertion(ICollection assertions) { TryImportWsspAssertion(assertions, MustNotSendAmendName); @@ -402,6 +595,25 @@ private bool TryImportWsspSignedEncryptedSupportingTokensAssertion(MetadataImpor return result; } + public override bool TryImportWsspRequireDerivedKeysAssertion(ICollection assertions, SecurityTokenParameters parameters) + { + parameters.RequireDerivedKeys = TryImportWsspAssertion(assertions, WSSecurityPolicy.RequireDerivedKeysName); + + if (!parameters.RequireDerivedKeys) + { + parameters.RequireDerivedKeys = TryImportWsspAssertion(assertions, WSSecurityPolicy12.RequireExplicitDerivedKeysName); + } + + if (!parameters.RequireDerivedKeys) + { + XmlElement assertion = null; + if (TryImportWsspAssertion(assertions, WSSecurityPolicy12.RequireImpliedDerivedKeysName, out assertion)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRServiceModel.UnsupportedSecurityPolicyAssertion, assertion.OuterXml))); + } + + return true; + } + public override XmlElement CreateWsspTrustAssertion(MetadataExporter exporter, SecurityKeyEntropyMode keyEntropyMode) { return CreateWsspTrustAssertion(Trust13Name, exporter, keyEntropyMode); @@ -411,5 +623,30 @@ public override bool TryImportWsspTrustAssertion(MetadataImporter importer, ICol { return TryImportWsspTrustAssertion(Trust13Name, importer, assertions, binding, out assertion); } + + public override XmlElement CreateWsspRsaTokenAssertion(RsaSecurityTokenParameters parameters) + { + XmlElement result = CreateWsspAssertion(KeyValueTokenName); + SetIncludeTokenValue(result, parameters.InclusionMode); + return result; + } + + public override bool TryImportWsspRsaTokenAssertion(MetadataImporter importer, XmlElement assertion, out SecurityTokenParameters parameters) + { + parameters = null; + + SecurityTokenInclusionMode inclusionMode; + Collection> alternatives; + + if (IsWsspAssertion(assertion, KeyValueTokenName) + && TryGetIncludeTokenValue(assertion, out inclusionMode) + && TryGetNestedPolicyAlternatives(importer, assertion, out alternatives) == false) + { + parameters = new RsaSecurityTokenParameters(); + parameters.InclusionMode = inclusionMode; + } + + return parameters != null; + } } } diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Auto/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Auto/Reference.cs index 585b6d62e9..c26a253d95 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Auto/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Auto/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/CollectionArray/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/CollectionArray/Reference.cs index 0d6fac6367..a497e8e002 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/CollectionArray/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/CollectionArray/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/DataContractSerializer/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/DataContractSerializer/Reference.cs index 9aef225548..65e5d86368 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/DataContractSerializer/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/DataContractSerializer/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/EnableDataBinding/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/EnableDataBinding/Reference.cs index 041be2fd6a..317640a825 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/EnableDataBinding/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/EnableDataBinding/Reference.cs @@ -1278,14 +1278,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1327,14 +1324,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1360,14 +1354,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/ExcludeType/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/ExcludeType/Reference.cs index 601e506ded..569b1c2f9f 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/ExcludeType/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/ExcludeType/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Internal/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Internal/Reference.cs index 978273c8c6..6bcf377da8 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Internal/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Internal/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/MessageContract/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/MessageContract/Reference.cs index 1ec535534d..a3d63f9245 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/MessageContract/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/MessageContract/Reference.cs @@ -1395,14 +1395,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1444,14 +1441,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1477,14 +1471,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/NoStdLib/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/NoStdLib/Reference.cs index 97c50995b6..22ac76f54d 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/NoStdLib/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/NoStdLib/Reference.cs @@ -1072,14 +1072,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1121,14 +1118,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1154,14 +1148,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/None/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/None/Reference.cs index f3621f3b6e..71cf3ca6ff 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/None/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/None/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Sync/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Sync/Reference.cs index 442b913853..9cc46b0fc5 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Sync/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/Sync/Reference.cs @@ -1176,14 +1176,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1225,14 +1222,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1258,14 +1252,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/XmlSerializer/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/XmlSerializer/Reference.cs index d35e63304f..849b7ee5bd 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/XmlSerializer/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/XmlSerializer/Reference.cs @@ -1955,14 +1955,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -2004,14 +2001,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -2037,14 +2031,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/wrapped/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/wrapped/Reference.cs index c97c6ba7b4..0e69578388 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/wrapped/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/CodeGenOptions/wrapped/Reference.cs @@ -2465,14 +2465,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -2514,14 +2511,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -2547,14 +2541,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/array/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/array/Reference.cs index adffe78746..de6ef932f1 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/array/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/array/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/arrayList/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/arrayList/Reference.cs index 25abe5c47c..626298f6bd 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/arrayList/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/arrayList/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/collection/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/collection/Reference.cs index f972dc0179..04ac1f7686 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/collection/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/collection/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/dictionary/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/dictionary/Reference.cs index acd7740244..b481e24039 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/dictionary/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/dictionary/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/hashTable/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/hashTable/Reference.cs index e4af8f401c..0c8fdf6146 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/hashTable/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/hashTable/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/hybridDictionary/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/hybridDictionary/Reference.cs index fcbfc86526..a41aca9b83 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/hybridDictionary/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/hybridDictionary/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/linkedList/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/linkedList/Reference.cs index 551a116d6f..b50a6ceaa5 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/linkedList/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/linkedList/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/list/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/list/Reference.cs index 05e14bc39f..029c12f5bb 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/list/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/list/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/listDictionary/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/listDictionary/Reference.cs index f97f88a181..ebf415ae81 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/listDictionary/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/listDictionary/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/observableCollection/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/observableCollection/Reference.cs index cfb35192a6..a51b55f70d 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/observableCollection/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/observableCollection/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/orderedDictionary/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/orderedDictionary/Reference.cs index a21fe49a19..4370b6376c 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/orderedDictionary/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/orderedDictionary/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedDictionary/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedDictionary/Reference.cs index 8aa2a828df..8c465df9b2 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedDictionary/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedDictionary/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedList/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedList/Reference.cs index 2390443fe1..2a0c48ee81 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedList/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedList/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedListNonGeneric/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedListNonGeneric/Reference.cs index 1eb555b001..9edbb4971f 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedListNonGeneric/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/Collections/sortedListNonGeneric/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/FullFramework/FullFramework/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/FullFramework/FullFramework/ServiceReference/Reference.cs index edd720c52c..03835255b3 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/FullFramework/FullFramework/ServiceReference/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/FullFramework/FullFramework/ServiceReference/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocAll/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocAll/Reference.cs index e1c1189b30..94835cb4a7 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocAll/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocAll/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocAllRelative/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocAllRelative/Reference.cs index 9f99618f6f..372ac3fd81 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocAllRelative/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocAllRelative/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocFullAndWildcard/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocFullAndWildcard/Reference.cs index 171c712b1c..a38d5e44e9 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocFullAndWildcard/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocFullAndWildcard/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocFullPath/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocFullPath/Reference.cs index 74596d47ce..21d3a5198a 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocFullPath/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocFullPath/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativeAndWildcard/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativeAndWildcard/Reference.cs index 09fb126dbb..708eed5018 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativeAndWildcard/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativeAndWildcard/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativePath/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativePath/Reference.cs index 0321a7e021..11ab3c1d8d 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativePath/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocRelativePath/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlRelXsdWildcard/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlRelXsdWildcard/Reference.cs index cbd175b8fd..7f2fbbc8c3 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlRelXsdWildcard/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlRelXsdWildcard/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlWildcard/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlWildcard/Reference.cs index 37608f5dcd..517261b62d 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlWildcard/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlWildcard/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlWildcardRelative/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlWildcardRelative/Reference.cs index 5bf8016a5d..f269b8b931 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlWildcardRelative/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlWildcardRelative/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlXsdWildcardRelative/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlXsdWildcardRelative/Reference.cs index e9f0f454fc..aeaf40550e 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlXsdWildcardRelative/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/MultipleDocuments/multiDocWsdlXsdWildcardRelative/Reference.cs @@ -1045,14 +1045,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -1094,14 +1091,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -1127,14 +1121,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/NamespaceParam/urlNamespace/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/NamespaceParam/urlNamespace/Reference.cs index 602e647ff6..6ddff1ebb4 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/NamespaceParam/urlNamespace/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/NamespaceParam/urlNamespace/Reference.cs @@ -908,14 +908,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -957,14 +954,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -990,14 +984,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/NamespaceParam/wildcardNamespace/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/NamespaceParam/wildcardNamespace/Reference.cs index 3ade131e71..6872e94a03 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/NamespaceParam/wildcardNamespace/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/NamespaceParam/wildcardNamespace/Reference.cs @@ -898,14 +898,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.defaultBasic)) @@ -947,14 +944,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } if ((endpointConfiguration == EndpointConfiguration.httpbinaryEndpoint)) @@ -980,14 +974,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } if ((endpointConfiguration == EndpointConfiguration.nettcpdefaultBinding)) diff --git a/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeNetHttpSvcs/NetHttp/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeNetHttpSvcs/NetHttp/Reference.cs index 8cbd31995b..051c3ccc8d 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeNetHttpSvcs/NetHttp/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeNetHttpSvcs/NetHttp/Reference.cs @@ -616,8 +616,8 @@ public interface IWcfService System.Threading.Tasks.Task TestFaultIntAsync(int faultCode); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfService/TestFaults", ReplyAction="http://tempuri.org/IWcfService/TestFaultsResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(NetHttp_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault2", Name="FaultDetail2", Namespace="http://www.contoso.com/wcfnamespace")] [System.ServiceModel.FaultContractAttribute(typeof(NetHttp_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault", Name="FaultDetail", Namespace="http://www.contoso.com/wcfnamespace")] + [System.ServiceModel.FaultContractAttribute(typeof(NetHttp_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault2", Name="FaultDetail2", Namespace="http://www.contoso.com/wcfnamespace")] [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] System.Threading.Tasks.Task TestFaultsAsync(NetHttp_NS.TestFaultsRequest request); @@ -2667,14 +2667,11 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } if ((endpointConfiguration == EndpointConfiguration.Text_IWcfService)) { - 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); diff --git a/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeNetHttpSvcs/NetHttps/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeNetHttpSvcs/NetHttps/Reference.cs index e879dcb7ec..d1628658b1 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeNetHttpSvcs/NetHttps/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeNetHttpSvcs/NetHttps/Reference.cs @@ -616,8 +616,8 @@ public interface IWcfService System.Threading.Tasks.Task TestFaultIntAsync(int faultCode); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfService/TestFaults", ReplyAction="http://tempuri.org/IWcfService/TestFaultsResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(NetHttps_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault2", Name="FaultDetail2", Namespace="http://www.contoso.com/wcfnamespace")] [System.ServiceModel.FaultContractAttribute(typeof(NetHttps_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault", Name="FaultDetail", Namespace="http://www.contoso.com/wcfnamespace")] + [System.ServiceModel.FaultContractAttribute(typeof(NetHttps_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault2", Name="FaultDetail2", Namespace="http://www.contoso.com/wcfnamespace")] [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] System.Threading.Tasks.Task TestFaultsAsync(NetHttps_NS.TestFaultsRequest request); @@ -2667,14 +2667,12 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } if ((endpointConfiguration == EndpointConfiguration.Text_IWcfService)) { - 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.Transport; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; return result; } throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); diff --git a/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeReliableSessionSvc/ReliableSessionService/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeReliableSessionSvc/ReliableSessionService/Reference.cs index 5dd65761ec..4139acacf1 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeReliableSessionSvc/ReliableSessionService/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/WcfRuntimeReliableSessionSvc/ReliableSessionService/Reference.cs @@ -192,61 +192,50 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } 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); + System.ServiceModel.WS2007HttpBinding result = new System.ServiceModel.WS2007HttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.ReliableSession.Enabled = true; + result.ReliableSession.Ordered = true; + result.ReliableSession.InactivityTimeout = new System.TimeSpan(6000000000); + result.Security.Mode = System.ServiceModel.SecurityMode.None; 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); + System.ServiceModel.WS2007HttpBinding result = new System.ServiceModel.WS2007HttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.ReliableSession.Enabled = true; + result.ReliableSession.Ordered = false; + result.ReliableSession.InactivityTimeout = new System.TimeSpan(6000000000); + result.Security.Mode = System.ServiceModel.SecurityMode.None; 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.ReliableSession.Enabled = true; + result.ReliableSession.Ordered = true; + result.ReliableSession.InactivityTimeout = new System.TimeSpan(6000000000); + result.Security.Mode = System.ServiceModel.SecurityMode.None; 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.ReliableSession.Enabled = true; + result.ReliableSession.Ordered = true; + result.ReliableSession.InactivityTimeout = new System.TimeSpan(6000000000); + result.Security.Mode = System.ServiceModel.SecurityMode.None; return result; } throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); diff --git a/src/dotnet-svcutil/lib/tests/Baselines/WsHttpBindingAndws2007HttpBindingTransSecMessCredsUserName/HttpsTransSecMessCredsUserName/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/WsHttpBindingAndws2007HttpBindingTransSecMessCredsUserName/HttpsTransSecMessCredsUserName/Reference.cs index 91f2686328..3a22a20d7f 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/WsHttpBindingAndws2007HttpBindingTransSecMessCredsUserName/HttpsTransSecMessCredsUserName/Reference.cs +++ b/src/dotnet-svcutil/lib/tests/Baselines/WsHttpBindingAndws2007HttpBindingTransSecMessCredsUserName/HttpsTransSecMessCredsUserName/Reference.cs @@ -616,8 +616,8 @@ public interface IWcfService System.Threading.Tasks.Task TestFaultIntAsync(int faultCode); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWcfService/TestFaults", ReplyAction="http://tempuri.org/IWcfService/TestFaultsResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(HttpsTransSecMessCredsUserName_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault2", Name="FaultDetail2", Namespace="http://www.contoso.com/wcfnamespace")] [System.ServiceModel.FaultContractAttribute(typeof(HttpsTransSecMessCredsUserName_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault", Name="FaultDetail", Namespace="http://www.contoso.com/wcfnamespace")] + [System.ServiceModel.FaultContractAttribute(typeof(HttpsTransSecMessCredsUserName_NS.FaultDetail), Action="http://tempuri.org/IWcfService/TestFaultFaultDetailFault2", Name="FaultDetail2", Namespace="http://www.contoso.com/wcfnamespace")] [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] System.Threading.Tasks.Task TestFaultsAsync(HttpsTransSecMessCredsUserName_NS.TestFaultsRequest request); @@ -2656,32 +2656,24 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi { if ((endpointConfiguration == EndpointConfiguration.https_message_credentials_username_IWcfService)) { - 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); + System.ServiceModel.WSHttpBinding result = new System.ServiceModel.WSHttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.TransportWithMessageCredential; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; + result.Security.Message.ClientCredentialType = System.ServiceModel.MessageCredentialType.UserName; return result; } if ((endpointConfiguration == EndpointConfiguration.https2007_message_credentials_username_IWcfService)) { - 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.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; - 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); + System.ServiceModel.WS2007HttpBinding result = new System.ServiceModel.WS2007HttpBinding(); + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.SecurityMode.TransportWithMessageCredential; + result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None; + result.Security.Message.ClientCredentialType = System.ServiceModel.MessageCredentialType.UserName; return result; } throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));