Port Classe

Definição

Define um ponto de extremidade individual contido no serviço Web XML. Essa classe não pode ser herdada.

public ref class Port sealed : System::Web::Services::Description::DocumentableItem
public ref class Port sealed : System::Web::Services::Description::NamedItem
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class Port : System.Web.Services.Description.DocumentableItem
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class Port : System.Web.Services.Description.NamedItem
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type Port = class
    inherit DocumentableItem
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type Port = class
    inherit NamedItem
Public NotInheritable Class Port
Inherits DocumentableItem
Public NotInheritable Class Port
Inherits NamedItem
Herança
Herança
Atributos

Exemplos

Os exemplos a seguir criam um Port e adicionam-no Ports à coleção de um nome myDescriptionexistenteServiceDescription.

// Create a Port.
Port^ postPort = gcnew Port;
postPort->Name = "PortServiceHttpPost";
postPort->Binding = gcnew XmlQualifiedName( "s0:PortServiceHttpPost" );

// Create an HttpAddressBinding.
HttpAddressBinding^ postAddressBinding = gcnew HttpAddressBinding;
postAddressBinding->Location = "http://localhost/PortClass/PortService_cs.asmx";

// Add the HttpAddressBinding to the Port.
postPort->Extensions->Add( postAddressBinding );

// Get the Service of the postPort.
Service^ myService = postPort->Service;

// Print the service name for the port.
Console::WriteLine( "This is the service name of the postPort:*{0}*", myDescription->Services[ 0 ]->Ports[ 0 ]->Service->Name );

// Add the Port to the PortCollection of the ServiceDescription.
myDescription->Services[ 0 ]->Ports->Add( postPort );
// Create a Port.
Port postPort = new Port();
postPort.Name = "PortServiceHttpPost";
postPort.Binding = new XmlQualifiedName("s0:PortServiceHttpPost");

// Create an HttpAddressBinding.
HttpAddressBinding postAddressBinding = new HttpAddressBinding();
postAddressBinding.Location =
   "http://localhost/PortClass/PortService_cs.asmx";

// Add the HttpAddressBinding to the Port.
postPort.Extensions.Add(postAddressBinding);

// Get the Service of the postPort.
Service myService = postPort.Service;

// Print the service name for the port.
Console.WriteLine("This is the service name of the postPort:*" +
   myDescription.Services[0].Ports[0].Service.Name + "*");

// Add the Port to the PortCollection of the ServiceDescription.
myDescription.Services[0].Ports.Add(postPort);

' Create a Port.
Dim postPort As New Port()
postPort.Name = "PortServiceHttpPost"
postPort.Binding = New XmlQualifiedName("s0:PortServiceHttpPost")


' Create an HttpAddressBinding.
Dim postAddressBinding As New HttpAddressBinding()
postAddressBinding.Location = _
   "http://localhost/PortClass/PortService.vb.asmx"

' Add the HttpAddressBinding to the Port.
postPort.Extensions.Add(postAddressBinding)

' Get the Service of the postPort.
Dim myService As Service = postPort.Service

' Print the service name for the port.
Console.WriteLine("This is the service name of the postPort:*" & _
   myDescription.Services(0).Ports(0).Service.Name & "*")

' Add the Port to the PortCollection of the ServiceDescription.
myDescription.Services(0).Ports.Add(postPort)

Comentários

Essa classe especifica um URI (endereço único) para um Binding, que define o formato da mensagem e os detalhes do protocolo para operações e mensagens para determinado PortType. A Binding propriedade obtém ou define esses valores para um especificado Port.

Essa classe corresponde ao elemento WSDL (Linguagem de Descrição dos Serviços Web), <port> que é delimitado pelo <service> elemento. Para obter mais informações sobre WSDL, confira a especificação WSDL.

Construtores

Port()

Inicializa uma nova instância da classe Port.

Propriedades

Binding

Obtém ou define o valor de atributo <binding> XML do Port.

Documentation

Obtém ou define a documentação de texto para a instância do DocumentableItem.

(Herdado de DocumentableItem)
DocumentationElement

Obtém ou define o elemento de documentação para o DocumentableItem.

(Herdado de DocumentableItem)
ExtensibleAttributes

Obtém ou define uma matriz do tipo XmlAttribute que representa extensões de atributo do WSDL para estarem em conformidade com o Perfil Básico 1.1 WS-I (Interoperabilidade de Serviços Web).

(Herdado de DocumentableItem)
Extensions

Obtém a coleção de elementos de extensibilidade associados ao Port.

Name

Obtém ou define o nome de Port.

Name

Obtém ou define o nome do item.

(Herdado de NamedItem)
Namespaces

Obtém ou define o dicionário de prefixos de namespace e os namespaces usados para preservar prefixos de namespace e namespaces quando um objeto ServiceDescription é construído.

(Herdado de DocumentableItem)
Service

Obtém o Service do qual o Port é um membro.

Métodos

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetHashCode()

Serve como a função de hash padrão.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.

(Herdado de Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.

(Herdado de Object)

Aplica-se a

Confira também