Compartir vía


Port Clase

Definición

Define un punto de conexión individual contenido en el servicio web XML. Esta clase no puede heredarse.

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
Herencia
Herencia
Atributos

Ejemplos

En los ejemplos siguientes se crea y Port se agrega a la Ports colección de un existente ServiceDescription denominado 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)

Comentarios

Esta clase especifica una única dirección (URI) para , Bindingque define el formato de mensaje y los detalles del protocolo para las operaciones y los mensajes de un determinado PortType. La Binding propiedad obtiene o establece esos valores para un especificado Port.

Esta clase corresponde al elemento Lenguaje de descripción de servicios web (WSDL), <port> que se incluye entre el <service> elemento . Para obtener más información sobre WSDL, consulte la especificación WSDL .

Constructores

Nombre Description
Port()

Inicializa una nueva instancia de la clase Port.

Propiedades

Nombre Description
Binding

Obtiene o establece el valor del atributo XML <binding> de .Port

Documentation

Obtiene o establece la documentación de texto de la instancia de DocumentableItem.

(Heredado de DocumentableItem)
DocumentationElement

Obtiene o establece el elemento de documentación de DocumentableItem.

(Heredado de DocumentableItem)
ExtensibleAttributes

Obtiene o establece una matriz de tipo XmlAttribute que representa las extensiones de atributo de WSDL para cumplir con la interoperabilidad de servicios web (WS-I) Perfil básico 1.1.

(Heredado de DocumentableItem)
Extensions

Obtiene la colección de elementos de extensibilidad asociados a .Port

Name

Obtiene o establece el nombre de .Port

Name

Obtiene o establece el nombre del elemento.

(Heredado de NamedItem)
Namespaces

Obtiene o establece el diccionario de prefijos de espacio de nombres y espacios de nombres usados para conservar los prefijos de espacio de nombres y los espacios de nombres cuando se construye un ServiceDescription objeto.

(Heredado de DocumentableItem)
Service

Obtiene el Service objeto del que Port es un miembro.

Métodos

Nombre Description
Equals(Object)

Determina si el objeto especificado es igual al objeto actual.

(Heredado de Object)
GetHashCode()

Actúa como función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Objectactual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Se aplica a

Consulte también