MessagePart.Type Property

Gets or sets the XML data type of the MessagePart.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

public:
property XmlQualifiedName^ Type {
	XmlQualifiedName^ get ();
	void set (XmlQualifiedName^ value);
}
/** @property */
public XmlQualifiedName get_Type ()

/** @property */
public void set_Type (XmlQualifiedName value)

public function get Type () : XmlQualifiedName

public function set Type (value : XmlQualifiedName)

Not applicable.

Property Value

An XmlQualifiedName.

This property corresponds to the type attribute of the part element for which the MessagePart class serves as a wrapper. In general, it refers to a data type defined in the XSD schema, but it can also be extended, as long as the XML namespace used is different from that of Web Services Description Language (WSDL).

The following example demonstrates a use of the Type property.

for ( int i = 0; i < myMessageCollection->Count; ++i )
{
   Console::WriteLine( "Message      : {0}", myMessageCollection[ i ]->Name );

   // Get Message Part Collection.
   MessagePartCollection^ myMessagePartCollection = myMessageCollection[ i ]->Parts;

   // Display type for each part in Message.
   for ( int k = 0; k < myMessagePartCollection->Count; k++ )
   {
      if ( myMessagePartCollection[ k ]->Type->Name->Equals( "" ) )
               Console::WriteLine( "\t       MessagePart does not contain type information" );
      else
      {
         Console::WriteLine( "\t       TypeName      : {0}", myMessagePartCollection[ k ]->Type->Name );
         Console::WriteLine( "\t       Namespace     : {0}", myMessagePartCollection[ k ]->Type->Namespace );
      }
   }
   Console::WriteLine( "" );
}

for (int i = 0; i < myMessageCollection.get_Count(); ++i) {
    Console.WriteLine("Message      : " 
        + myMessageCollection.get_Item(i).get_Name());

    // Get Message Part Collection.
    MessagePartCollection myMessagePartCollection = 
        myMessageCollection.get_Item(i).get_Parts();

    // Display type for each part in Message.
    for (int k = 0; k < myMessagePartCollection.get_Count(); k++) {
        if (myMessagePartCollection.get_Item(k).get_Type().
            get_Name().Equals("")) {
            Console.WriteLine("\t       MessagePart does not contain "
                + "type information");
        }
        else {
            Console.WriteLine("\t       TypeName      : " 
                + myMessagePartCollection.get_Item(k).get_Type().
                get_Name());
            Console.WriteLine("\t       Namespace     : " 
                + myMessagePartCollection.get_Item(k).get_Type().
                get_Namespace());
        }
    }
    Console.WriteLine("");
}

Windows 98, Windows Server 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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: