Port クラス
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文
解説
このクラスは、Binding のための単一のアドレス (URI) を指定します。このバインディングによって、特定の PortType の操作とメッセージに対するメッセージ形式とプロトコルの詳細を定義します。Binding プロパティは、指定した Port のこれらの値を取得または設定します。
このクラスは、<service> 要素によって囲まれた Web サービス記述言語 (WSDL: Web Services Description Language) <port> 要素に対応します。WSDL の詳細については、http://www.w3.org/TR/wsdl/ の仕様を参照してください。
' 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)
// 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. 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.set_Name("PortServiceHttpPost"); postPort.set_Binding( new XmlQualifiedName("s0:PortServiceHttpPost")); // Create an HttpAddressBinding. HttpAddressBinding postAddressBinding = new HttpAddressBinding(); postAddressBinding.set_Location( "http://localhost/PortClass/PortService_jsl.asmx"); // Add the HttpAddressBinding to the Port. postPort.get_Extensions().Add(postAddressBinding); // Get the Service of the postPort. Service myService = postPort.get_Service(); // Print the service name for the port. Console.WriteLine("This is the service name of the postPort:*" + myDescription.get_Services().get_Item(0).get_Ports(). get_Item(0).get_Service().get_Name() + "*"); // Add the Port to the PortCollection of the ServiceDescription. myDescription.get_Services().get_Item(0).get_Ports().Add(postPort);
System.Web.Services.Description.DocumentableItem
System.Web.Services.Description.NamedItem
System.Web.Services.Description.Port
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- Port クラスのページへのリンク