MimePart Class

Represents an extensibility element added to a MimeMultipartRelatedBinding, specifying the concrete MIME type for the MessagePart to which the MimePart applies. This class cannot be inherited.

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

Public NotInheritable Class MimePart
	Inherits ServiceDescriptionFormatExtension
Dim instance As MimePart

public final class MimePart extends ServiceDescriptionFormatExtension
public final class MimePart extends ServiceDescriptionFormatExtension
Not applicable.

For more information about specifying protocols for XML Web services, see XML Web Services Using ASP.NET. For more information about Web Services Description Language (WSDL), see the specification at http://www.w3.org/TR/wsdl/.

The following example demonstrates the use of the methods and properties exposed by the MimePart class.

Imports System
Imports System.Xml
Imports System.Web.Services.Description

Public Class MyMimePart
   Public Shared Sub Main()
      Dim myServiceDescription As ServiceDescription = _
      Dim myServiceDescriptionCol As New ServiceDescriptionCollection()
      Dim myXmlQualifiedName As _
         New XmlQualifiedName("MimeServiceHttpPost", "http://tempuri.org/")

      ' Create the Binding.
      Dim myBinding As Binding = _
      Dim myOperationBinding As OperationBinding = Nothing
      Dim i As Integer
      For i = 0 To myBinding.Operations.Count - 1
         If myBinding.Operations(i).Name.Equals("AddNumbers") Then
            myOperationBinding = myBinding.Operations(i)
         End If
      Next i
      ' Create the OutputBinding.
      Dim myOutputBinding As OutputBinding = myOperationBinding.Output
      Dim myMimeXmlBinding As New MimeXmlBinding()
      myMimeXmlBinding.Part = "body"

      ' Create the MimePart.
      Dim myMimePart As New MimePart()
      Dim myMimePartRelatedBinding As New MimeMultipartRelatedBinding()

      ' Add the MimePart to the MimePartRelatedBinding.
      Console.WriteLine( _
         "MimePart_3_Output_vb.wsdl has been generated successfully.")
   End Sub 'Main
End Class 'MyMimePart

import System.*;
import System.Xml.*;
import System.Web.Services.Description.*;

public class MyMimePart
    public static void main(String[] args)
        ServiceDescription myServiceDescription = 
        ServiceDescriptionCollection myServiceDescriptionCol = 
            new ServiceDescriptionCollection();
        XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
            "MimeServiceHttpPost", "http://tempuri.org/");

        // Create the Binding.
        Binding myBinding = myServiceDescriptionCol.GetBinding(
        OperationBinding myOperationBinding = null;
        for (int i = 0; i < myBinding.get_Operations().get_Count(); i++) {
            if (myBinding.get_Operations().get_Item(i).get_Name().
                Equals("AddNumbers")) {
                myOperationBinding = myBinding.get_Operations().get_Item(i);

        // Create the OutputBinding.
        OutputBinding myOutputBinding = myOperationBinding.get_Output();
        MimeXmlBinding myMimeXmlBinding = new MimeXmlBinding();

        // Create the MimePart.
        MimePart myMimePart = new MimePart();
        MimeMultipartRelatedBinding myMimePartRelatedBinding =
            new MimeMultipartRelatedBinding();

        // Add the MimePart to the MimePartRelatedBinding.

        Console.WriteLine("MimePart_3_Output_JSL.wsdl has been generated "
            + "successfully.");
    } //main
} //MyMimePart

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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