WSHttpBinding Construtores

Definição

Inicializa uma nova instância da classe WSHttpBinding.Initializes a new instance of the WSHttpBinding class.

Sobrecargas

WSHttpBinding()

Inicializa uma nova instância da classe WSHttpBinding.Initializes a new instance of the WSHttpBinding class.

WSHttpBinding(SecurityMode)

Inicializa uma nova instância da classe WSHttpBinding com um tipo de segurança especificado usado pela associação.Initializes a new instance of the WSHttpBinding class with a specified type of security used by the binding.

WSHttpBinding(String)

Inicializa uma nova instância da classe WSHttpBinding com uma associação especificada pelo seu nome de configuração.Initializes a new instance of the WSHttpBinding class with a binding specified by its configuration name.

WSHttpBinding(SecurityMode, Boolean)

Inicializa uma nova instância da classe WSHttpBinding com um tipo especificado de segurança usado pela associação e um valor que indica se uma sessão confiável está habilitada.Initializes a new instance of the WSHttpBinding class with a specified type of security used by the binding and a value that indicates whether a reliable session is enabled.

WSHttpBinding()

Inicializa uma nova instância da classe WSHttpBinding.Initializes a new instance of the WSHttpBinding class.

public:
 WSHttpBinding();
public WSHttpBinding ();
Public Sub New ()

Exemplos

O código de exemplo a seguir mostra como inicializar uma nova instância da WSHttpBinding classe.The following sample code shows how to initialize a new instance of the WSHttpBinding class.

WSHttpBinding binding = new WSHttpBinding();
binding.Name = "binding1";
binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
binding.Security.Mode = SecurityMode.Message;
binding.ReliableSession.Enabled = false;
binding.TransactionFlow = false;
Dim binding As New WSHttpBinding()
With binding
    .Name = "binding1"
    .HostNameComparisonMode = HostNameComparisonMode.StrongWildcard
    .Security.Mode = SecurityMode.Message
    .ReliableSession.Enabled = False
    .TransactionFlow = False
End With

Aplica-se a

WSHttpBinding(SecurityMode)

Inicializa uma nova instância da classe WSHttpBinding com um tipo de segurança especificado usado pela associação.Initializes a new instance of the WSHttpBinding class with a specified type of security used by the binding.

public:
 WSHttpBinding(System::ServiceModel::SecurityMode securityMode);
public WSHttpBinding (System.ServiceModel.SecurityMode securityMode);
new System.ServiceModel.WSHttpBinding : System.ServiceModel.SecurityMode -> System.ServiceModel.WSHttpBinding
Public Sub New (securityMode As SecurityMode)

Parâmetros

securityMode
SecurityMode

O valor de SecurityMode que especifica o tipo de segurança usado com a mensagem SOAP e para o cliente.The value of SecurityMode that specifies the type of security that is used with the SOAP message and for the client.

Exemplos

O exemplo a seguir mostra como inicializar uma nova instância da WSHttpBinding classe com um securityMode parâmetro.The following example shows how to initialize a new instance of the WSHttpBinding class with a securityMode parameter.

// The security mode is set to Message.
WSHttpBinding binding = new WSHttpBinding(SecurityMode.Message);
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
return binding;
' The security mode is set to Message.
Dim binding As New WSHttpBinding(SecurityMode.Message)
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows
Return binding

Aplica-se a

WSHttpBinding(String)

Inicializa uma nova instância da classe WSHttpBinding com uma associação especificada pelo seu nome de configuração.Initializes a new instance of the WSHttpBinding class with a binding specified by its configuration name.

public:
 WSHttpBinding(System::String ^ configName);
public WSHttpBinding (string configName);
new System.ServiceModel.WSHttpBinding : string -> System.ServiceModel.WSHttpBinding
Public Sub New (configName As String)

Parâmetros

configName
String

O nome da configuração da associação do WSHttpBindingElement.The binding configuration name for the WSHttpBindingElement.

Exceções

O elemento de associação com o nome configName não foi encontrado.The binding element with the name configName was not found.

Exemplos

O exemplo a seguir mostra como inicializar uma nova instância da WSHttpBinding classe com um argumento de cadeia de caracteres.The following example shows how to initialize a new instance of the WSHttpBinding class with a string argument.

// Set the IssuerBinding to a WSHttpBinding loaded from config
b.Security.Message.IssuerBinding = new WSHttpBinding("Issuer");
' Set the IssuerBinding to a WSHttpBinding loaded from config
b.Security.Message.IssuerBinding = New WSHttpBinding("Issuer")

Aplica-se a

WSHttpBinding(SecurityMode, Boolean)

Inicializa uma nova instância da classe WSHttpBinding com um tipo especificado de segurança usado pela associação e um valor que indica se uma sessão confiável está habilitada.Initializes a new instance of the WSHttpBinding class with a specified type of security used by the binding and a value that indicates whether a reliable session is enabled.

public:
 WSHttpBinding(System::ServiceModel::SecurityMode securityMode, bool reliableSessionEnabled);
public WSHttpBinding (System.ServiceModel.SecurityMode securityMode, bool reliableSessionEnabled);
new System.ServiceModel.WSHttpBinding : System.ServiceModel.SecurityMode * bool -> System.ServiceModel.WSHttpBinding
Public Sub New (securityMode As SecurityMode, reliableSessionEnabled As Boolean)

Parâmetros

securityMode
SecurityMode

O valor de SecurityMode que especifica o tipo de segurança usado com a mensagem SOAP e para o cliente.The value of SecurityMode that specifies the type of security that is used with the SOAP message and for the client.

reliableSessionEnabled
Boolean

true se uma sessão confiável estiver habilitada, caso contrário, false.true if a reliable session is enabled; otherwise, false.

Exemplos

O exemplo a seguir mostra como inicializar uma nova instância da WSHttpBinding classe com um securityMode parâmetro e reliableSessionEnabled .The following example shows how to initialize a new instance of the WSHttpBinding class with a securityMode and reliableSessionEnabled parameter.

// securityMode is Message
// reliableSessionEnabled is true
WSHttpBinding binding = new WSHttpBinding(SecurityMode.Message, true);
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
' securityMode is Message
' reliableSessionEnabled is true
Dim binding As New WSHttpBinding(SecurityMode.Message, True)
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows

Aplica-se a