次の方法で共有


PortType.ServiceDescription プロパティ

PortType がメンバとして含まれている ServiceDescription を取得します。

Public ReadOnly Property ServiceDescription As ServiceDescription
[C#]
public ServiceDescription ServiceDescription {get;}
[C++]
public: __property ServiceDescription* get_ServiceDescription();
[JScript]
public function get ServiceDescription() : ServiceDescription;

プロパティ値

ServiceDescription

使用例

 
Dim myPortTypeCollection As PortTypeCollection
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("MathService_VB.wsdl")

myPortTypeCollection = myServiceDescription.PortTypes
Dim myPortType As PortType = myPortTypeCollection("MathServiceSoap")

' Get the ServiceDescription of myPortType.
Dim myPortTypeServiceDescription As ServiceDescription = _
   myPortType.ServiceDescription
Dim myMessageCollection As MessageCollection = _
   myPortTypeServiceDescription.Messages

Console.WriteLine("No. of messages in this ServiceDescription: " _
   & myMessageCollection.Count.ToString())

' Display all the messages.
Dim myMessage As Message
For Each myMessage In  myMessageCollection
   Console.WriteLine("Message: " & myMessage.Name)
Next myMessage 

[C#] 
PortTypeCollection myPortTypeCollection;
ServiceDescription myServiceDescription =
   ServiceDescription.Read("MathService_CS.wsdl");

myPortTypeCollection = myServiceDescription.PortTypes;
PortType myPortType = myPortTypeCollection["MathServiceSoap"];

// Get the ServiceDescription of myPortType.
ServiceDescription myPortTypeServiceDescription = 
   myPortType.ServiceDescription;
MessageCollection myMessageCollection = 
   myPortTypeServiceDescription.Messages;
                             
Console.WriteLine("No. of messages in this ServiceDescription: "
   + myMessageCollection.Count);

// Display all the messages.
foreach(Message myMessage in myMessageCollection)
   Console.WriteLine("Message: " + myMessage.Name);

[C++] 
PortTypeCollection* myPortTypeCollection;
ServiceDescription* myServiceDescription =
   ServiceDescription::Read(S"MathService_Cpp.wsdl");

myPortTypeCollection = myServiceDescription->PortTypes;
PortType* myPortType = myPortTypeCollection->Item[S"MathServiceSoap"];

// Get the ServiceDescription of myPortType.
ServiceDescription * myPortTypeServiceDescription = 
   myPortType->ServiceDescription;
MessageCollection * myMessageCollection = 
   myPortTypeServiceDescription->Messages;

Console::WriteLine(S"No. of messages in this ServiceDescription: {0}", 
   __box(myMessageCollection->Count));

// Display all the messages.
IEnumerator* myEnum = myMessageCollection->GetEnumerator();
while (myEnum->MoveNext())
{
   Message* myMessage = __try_cast<Message*>(myEnum->Current);
   Console::WriteLine(S"Message : {0}", myMessage->Name);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

PortType クラス | PortType メンバ | System.Web.Services.Description 名前空間