This documentation is archived and is not being maintained.
PortType.ServiceDescription Property
.NET Framework 1.1
Gets the ServiceDescription of which the PortType is a member.
[Visual Basic] Public ReadOnly Property ServiceDescription As ServiceDescription [C#] public ServiceDescription ServiceDescription {get;} [C++] public: __property ServiceDescription* get_ServiceDescription(); [JScript] public function get ServiceDescription() : ServiceDescription;
Property Value
Example
[Visual Basic] 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] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
PortType Class | PortType Members | System.Web.Services.Description Namespace
Show: