Port Klasa
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Definiuje pojedynczy punkt końcowy zawarty w usłudze sieci Web XML. Klasa ta nie może być dziedziczona.
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
- Dziedziczenie
- Dziedziczenie
- Atrybuty
Przykłady
Poniższe przykłady tworzą obiekt Port i dodaje go do Ports kolekcji istniejącej ServiceDescription o nazwie 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)
Uwagi
Ta klasa określa pojedynczy adres (URI) dla elementu Binding, który definiuje format komunikatu i szczegóły protokołu dla operacji i komunikatów dla danego PortTypeelementu . Właściwość Binding pobiera lub ustawia te wartości dla określonego Portelementu .
Ta klasa odpowiada elementowi WSDL (Web Services Description Language), <port> który jest ujęta przez <service> element. Aby uzyskać więcej informacji na temat języka WSDL, zobacz specyfikację WSDL .
Konstruktory
| Port() |
Inicjuje nowe wystąpienie klasy Port. |
Właściwości
| Binding |
Pobiera lub ustawia wartość atrybutu XML |
| Documentation |
Pobiera lub ustawia dokumentację tekstu dla wystąpienia klasy DocumentableItem. (Odziedziczone po DocumentableItem) |
| DocumentationElement |
Pobiera lub ustawia element dokumentacji dla elementu DocumentableItem. (Odziedziczone po DocumentableItem) |
| ExtensibleAttributes |
Pobiera lub ustawia tablicę typu XmlAttribute reprezentującą rozszerzenia atrybutów języka WSDL w celu zachowania zgodności z podstawowym profilem 1.1 usług sieci Web (WS-I). (Odziedziczone po DocumentableItem) |
| Extensions |
Pobiera kolekcję elementów rozszerzalności skojarzonych z elementami Port. |
| Name |
Pobiera lub ustawia nazwę elementu Port. |
| Name |
Pobiera lub ustawia nazwę elementu. (Odziedziczone po NamedItem) |
| Namespaces |
Pobiera lub ustawia słownik prefiksów przestrzeni nazw i przestrzeni nazw używanych do zachowywania prefiksów przestrzeni nazw i przestrzeni nazw podczas ServiceDescription konstruowania obiektu. (Odziedziczone po DocumentableItem) |
| Service |
Metody
| Equals(Object) |
Określa, czy dany obiekt jest taki sam, jak bieżący obiekt. (Odziedziczone po Object) |
| GetHashCode() |
Służy jako domyślna funkcja skrótu. (Odziedziczone po Object) |
| GetType() |
Type Pobiera wartość bieżącego wystąpienia. (Odziedziczone po Object) |
| MemberwiseClone() |
Tworzy płytkią kopię bieżącego Objectelementu . (Odziedziczone po Object) |
| ToString() |
Zwraca ciąg reprezentujący bieżący obiekt. (Odziedziczone po Object) |