Port Classe
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Define um endpoint individual contido no serviço Web XML. Esta 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 seguintes criam um Port e adicionam-no à Ports coleção de um existente ServiceDescription nomeado myDescription.
// 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)
Observações
Esta classe especifica um único endereço (URI) para um Binding, que define o formato da mensagem e detalhes do protocolo para operações e mensagens para um dado PortType. A Binding propriedade obtém ou define esses valores para um determinado Port.
Esta classe corresponde ao elemento Web Services Description Language (WSDL <port> ), que é incluído pelo <service> elemento. Para mais informações sobre o WSDL, consulte a especificação WSDL .
Construtores
| Name | Description |
|---|---|
| Port() |
Inicializa uma nova instância da Port classe. |
Propriedades
| Name | Description |
|---|---|
| Binding |
Obtém ou define o valor do atributo XML |
| 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 um array de tipos XmlAttribute que representam extensões de atributos do WSDL para cumprir o Perfil Básico 1.1 da Interoperabilidade de Serviços Web (WS-I). (Herdado de DocumentableItem) |
| Extensions |
Obtém a coleção de elementos de extensibilidade associados ao Port. |
| Name |
Obtém ou define o nome do Port. |
| Name |
Obtém ou define o nome do item. (Herdado de NamedItem) |
| Namespaces |
Obtém ou define o dicionário dos prefixos e espaços de nomes usados para preservar prefixos e espaços de nomes quando um ServiceDescription objeto é construído. (Herdado de DocumentableItem) |
| Service |
Métodos
| Name | Description |
|---|---|
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual. (Herdado de Object) |
| GetHashCode() |
Serve como função de hash predefinida. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do atual Object. (Herdado de Object) |
| ToString() |
Devolve uma cadeia que representa o objeto atual. (Herdado de Object) |