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.
System.Web.Services.Description.ServiceDescriptionFormatExtension
System.Web.Services.Description.MimePart
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in System.Web.Services.dll)
The MimePart type exposes the following members.
| 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 a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | 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.
using System; using System.Xml; using System.Web.Services.Description; public class MyMimePart { public static void Main() { ServiceDescription myServiceDescription = ServiceDescription.Read("MimePart_3_Input_cs.wsdl"); ServiceDescriptionCollection myServiceDescriptionCol = new ServiceDescriptionCollection(); myServiceDescriptionCol.Add(myServiceDescription); XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("MimeServiceHttpPost","http://tempuri.org/"); // Create the Binding. Binding myBinding = myServiceDescriptionCol.GetBinding(myXmlQualifiedName); OperationBinding myOperationBinding= null; for(int i=0; i< myBinding.Operations.Count; i++) { if(myBinding.Operations[i].Name.Equals("AddNumbers")) { myOperationBinding = myBinding.Operations[i]; } } // Create the OutputBinding. OutputBinding myOutputBinding = myOperationBinding.Output; MimeXmlBinding myMimeXmlBinding = new MimeXmlBinding(); myMimeXmlBinding.Part = "body"; // Create the MimePart. MimePart myMimePart = new MimePart(); myMimePart.Extensions.Add(myMimeXmlBinding); MimeMultipartRelatedBinding myMimePartRelatedBinding = new MimeMultipartRelatedBinding(); // Add the MimePart to the MimePartRelatedBinding. myMimePartRelatedBinding.Parts.Add(myMimePart); myOutputBinding.Extensions.Add(myMimePartRelatedBinding); myServiceDescription.Write("MimePart_3_Output_CS.wsdl"); Console.WriteLine( "MimePart_3_Output_CS.wsdl has been generated successfully."); } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
