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.
Assembly: System.Web.Services (in System.Web.Services.dll)
System.Web.Services.Description.ServiceDescriptionFormatExtension
System.Web.Services.Description.MimePart
| Name | Description | |
|---|---|---|
![]() | MimePart() | Initializes a new instance of the MimePart class. |
| Name | Description | |
|---|---|---|
![]() | Extensions | Gets the collection of MIME extensibility elements for the part of the MimeMultipartRelatedBinding of which the MimePart is a member. |
![]() | Handled | Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is used by the import process when the extensibility element is imported.(Inherited from ServiceDescriptionFormatExtension.) |
![]() | Parent | Gets the parent of the ServiceDescriptionFormatExtension.(Inherited from ServiceDescriptionFormatExtension.) |
![]() | Required | Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is necessary for the action to which it refers.(Inherited from ServiceDescriptionFormatExtension.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
For more information about specifying protocols for XML Web services, see [<topic://cpconbuildingaspnetwebservices>]. 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 = _ ServiceDescription.Read("MimePart_3_Input_vb.wsdl") Dim myServiceDescriptionCol As New ServiceDescriptionCollection() myServiceDescriptionCol.Add(myServiceDescription) Dim myXmlQualifiedName As _ New XmlQualifiedName("MimeServiceHttpPost", "http://tempuri.org/") ' Create the Binding. Dim myBinding As Binding = _ myServiceDescriptionCol.GetBinding(myXmlQualifiedName) 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() myMimePart.Extensions.Add(myMimeXmlBinding) Dim myMimePartRelatedBinding As New MimeMultipartRelatedBinding() ' Add the MimePart to the MimePartRelatedBinding. myMimePartRelatedBinding.Parts.Add(myMimePart) myOutputBinding.Extensions.Add(myMimePartRelatedBinding) myServiceDescription.Write("MimePart_3_Output_vb.wsdl") Console.WriteLine( _ "MimePart_3_Output_vb.wsdl has been generated successfully.") End Sub 'Main End Class 'MyMimePart
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

