Port Klasse

Definition

Definiert einen einzelnen, im XML-Webdienst enthaltenen Endpunkt. Diese Klasse kann nicht vererbt werden.

public ref class Port sealed : System::Web::Services::Description::NamedItem
public ref class Port sealed : 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")]
public sealed class Port : System.Web.Services.Description.DocumentableItem
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type Port = class
    inherit NamedItem
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type Port = class
    inherit DocumentableItem
Public NotInheritable Class Port
Inherits NamedItem
Public NotInheritable Class Port
Inherits DocumentableItem
Vererbung
Vererbung
Attribute

Beispiele

In den folgenden Beispielen wird ein Port erstellt und der Ports Auflistung eines vorhandenen ServiceDescription namens myDescriptionhinzugefügt.

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

Hinweise

Diese Klasse gibt eine einzelne Adresse (URI) für einen Bindingan, der das Nachrichtenformat und Protokolldetails für Vorgänge und Nachrichten für eine bestimmte PortTypedefiniert. Die Binding -Eigenschaft ruft diese Werte für ein angegebenes Portab oder legt diese fest.

Diese Klasse entspricht dem WSDL-Element (Web Services Description Language), <port> das vom <service> -Element eingeschlossen wird. Weitere Informationen zu WSDL finden Sie in der WSDL-Spezifikation.

Konstruktoren

Port()

Initialisiert eine neue Instanz der Port-Klasse.

Eigenschaften

Binding

Ruft den Wert des XML-<binding>-Attributs des Port ab oder legt diesen fest.

Documentation

Ruft die Textdokumentation für die Instanz von DocumentableItem ab oder legt diese fest.

(Geerbt von DocumentableItem)
DocumentationElement

Ruft das Dokumentationselement für das DocumentableItem ab oder legt dieses fest.

(Geerbt von DocumentableItem)
ExtensibleAttributes

Ruft ein Array vom Typ XmlAttribute ab, das Attributerweiterungen von WSDL darstellt, um dem WS-I-Basisprofil 1.1 (Web Services Interoperability) zu entsprechen, oder legt dieses fest.

(Geerbt von DocumentableItem)
Extensions

Ruft die Auflistung der Erweiterbarkeitselemente ab, die dem Port zugeordnet sind.

Name

Ruft den Namen der Port ab oder legt diesen fest.

Name

Ruft den Namen des Elements ab oder legt diesen fest.

(Geerbt von NamedItem)
Namespaces

Ruft das Wörterbuch der Namespacepräfixe und Namespaces ab, die verwendet werden, um die Namespacepräfixe und Namespaces beim Erstellen eines ServiceDescription-Objekts beizubehalten.

(Geerbt von DocumentableItem)
Service

Ruft die Service ab, zu deren Membern Port gehört.

Methoden

Equals(Object)

Bestimmt, ob das angegebene Objekt gleich dem aktuellen Objekt ist.

(Geerbt von Object)
GetHashCode()

Fungiert als Standardhashfunktion.

(Geerbt von Object)
GetType()

Ruft den Type der aktuellen Instanz ab.

(Geerbt von Object)
MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.

(Geerbt von Object)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)

Gilt für:

Weitere Informationen