Port Klasse
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Definiert einen einzelnen Endpunkt, der im XML-Webdienst enthalten ist. Diese Klasse kann nicht vererbt werden.
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
- Vererbung
- Vererbung
- Attribute
Beispiele
In den folgenden Beispielen wird eine Port Datei erstellt und der Ports Auflistung einer vorhandenen ServiceDescription benannten myDescriptionAuflistung hinzugefü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 ein Binding, das Nachrichtenformat und Protokolldetails für Vorgänge und Nachrichten für einen bestimmten PortTypeWert definiert. Die Binding Eigenschaft ruft diese Werte für einen angegebenen PortWert ab oder legt diese fest.
Diese Klasse entspricht dem Web Services Description Language (WSDL) <port> -Element, das vom <service> Element eingeschlossen wird. Weitere Informationen zu WSDL finden Sie in der WSDL-Spezifikation .
Konstruktoren
| Name | Beschreibung |
|---|---|
| Port() |
Initialisiert eine neue Instanz der Port-Klasse. |
Eigenschaften
| Name | Beschreibung |
|---|---|
| Binding |
Dient zum Abrufen oder Festlegen des Werts des XML-Attributs |
| Documentation |
Ruft die Textdokumentation für die Instanz der DocumentableItem. (Geerbt von DocumentableItem) |
| DocumentationElement |
Ruft ab oder legt das Dokumentationselement für die DocumentableItem. (Geerbt von DocumentableItem) |
| ExtensibleAttributes |
Dient zum Abrufen oder Festlegen eines Arrays vom Typ XmlAttribute , das Attributerweiterungen von WSDL darstellt, um web Services Interoperability (WS-I) Basic Profile 1.1 einzuhalten. (Geerbt von DocumentableItem) |
| Extensions |
Ruft die Auflistung der Erweiterbarkeitselemente ab, die der Port. |
| Name |
Dient zum Abrufen oder Festlegen des Namens der Port. |
| Name |
Dient zum Abrufen oder Festlegen des Namens des Elements. (Geerbt von NamedItem) |
| Namespaces |
Ruft das Wörterbuch der Namespacepräfixe und Namespaces ab, die zum Beibehalten von Namespacepräfixen und Namespaces verwendet werden, wenn ein ServiceDescription Objekt erstellt wird, oder legt es fest. (Geerbt von DocumentableItem) |
| Service |
Methoden
| Name | Beschreibung |
|---|---|
| Equals(Object) |
Bestimmt, ob das angegebene Objekt dem aktuellen Objekt entspricht. (Geerbt von Object) |
| GetHashCode() |
Dient als Standardhashfunktion. (Geerbt von Object) |
| GetType() |
Ruft die Type der aktuellen Instanz ab. (Geerbt von Object) |
| MemberwiseClone() |
Erstellt eine flache Kopie der aktuellen Object. (Geerbt von Object) |
| ToString() |
Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. (Geerbt von Object) |