Condividi tramite


Port Classe

Definizione

Definisce un singolo endpoint contenuto nel servizio Web XML. Questa classe non può essere ereditata.

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
Ereditarietà
Ereditarietà
Attributi

Esempio

Gli esempi seguenti creano un Port oggetto e lo aggiungono alla Ports raccolta di un oggetto denominato myDescriptionesistenteServiceDescription.

// 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)

Commenti

Questa classe specifica un singolo indirizzo (URI) per un Bindingoggetto , che definisce il formato del messaggio e i dettagli del protocollo per operazioni e messaggi per un determinato PortTypeoggetto . La Binding proprietà ottiene o imposta tali valori per un oggetto specificato Port.

Questa classe corrisponde all'elemento WSDL (Web Services Description Language), <port> racchiuso dall'elemento <service> . Per altre informazioni su WSDL, vedere la specifica WSDL .

Costruttori

Nome Descrizione
Port()

Inizializza una nuova istanza della classe Port.

Proprietà

Nome Descrizione
Binding

Ottiene o imposta il valore dell'attributo XML <binding> dell'oggetto Port.

Documentation

Ottiene o imposta la documentazione di testo per l'istanza di DocumentableItem.

(Ereditato da DocumentableItem)
DocumentationElement

Ottiene o imposta l'elemento della documentazione per .DocumentableItem

(Ereditato da DocumentableItem)
ExtensibleAttributes

Ottiene o imposta una matrice di tipo XmlAttribute che rappresenta le estensioni degli attributi di WSDL in modo che siano conformi all'interoperabilità dei servizi Web (WS-I) Basic Profile 1.1.

(Ereditato da DocumentableItem)
Extensions

Ottiene la raccolta di elementi di estendibilità associati all'oggetto Port.

Name

Ottiene o imposta il nome dell'oggetto Port.

Name

Ottiene o imposta il nome dell'elemento.

(Ereditato da NamedItem)
Namespaces

Ottiene o imposta il dizionario dei prefissi e degli spazi dei nomi usati per mantenere i prefissi e gli spazi dei nomi degli spazi dei nomi quando viene costruito un ServiceDescription oggetto.

(Ereditato da DocumentableItem)
Service

Ottiene l'oggetto Service di cui è Port un membro.

Metodi

Nome Descrizione
Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a

Vedi anche