Bagikan melalui


Port Kelas

Definisi

Menentukan titik akhir individual yang terkandung dalam layanan Web XML. Kelas ini tidak dapat diwariskan.

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
Warisan
Warisan
Atribut

Contoh

Contoh berikut membuat Port dan menambahkannya ke Ports koleksi yang sudah ada ServiceDescription bernama 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)

Keterangan

Kelas ini menentukan satu alamat (URI) untuk Binding, yang menentukan format pesan dan detail protokol untuk operasi dan pesan untuk .PortType Properti Binding mendapatkan atau mengatur nilai tersebut untuk Port.

Kelas ini sesuai dengan elemen Web Services Description Language (WSDL), <port> yang diapit oleh <service> elemen . Untuk informasi selengkapnya tentang WSDL, lihat spesifikasi WSDL .

Konstruktor

Nama Deskripsi
Port()

Menginisialisasi instans baru dari kelas Port.

Properti

Nama Deskripsi
Binding

Mendapatkan atau mengatur nilai atribut XML <binding> dari Port.

Documentation

Mendapatkan atau mengatur dokumentasi teks untuk instans DocumentableItem.

(Diperoleh dari DocumentableItem)
DocumentationElement

Mendapatkan atau mengatur elemen dokumentasi untuk DocumentableItem.

(Diperoleh dari DocumentableItem)
ExtensibleAttributes

Mendapatkan atau mengatur array jenis XmlAttribute yang mewakili ekstensi atribut WSDL untuk mematuhi Interoperabilitas Layanan Web (WS-I) Profil Dasar 1.1.

(Diperoleh dari DocumentableItem)
Extensions

Mendapatkan kumpulan elemen ekstensibilitas yang terkait dengan Port.

Name

Mendapatkan atau menetapkan nama Port.

Name

Mendapatkan atau mengatur nama item.

(Diperoleh dari NamedItem)
Namespaces

Mendapatkan atau mengatur kamus awalan namespace layanan dan namespace yang digunakan untuk mempertahankan awalan namespace layanan dan namespace saat ServiceDescription objek dibangun.

(Diperoleh dari DocumentableItem)
Service

Mendapatkan yang ServicePort merupakan anggota.

Metode

Nama Deskripsi
Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Berlaku untuk

Lihat juga