Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MimeXmlBinding Class
Collapse the table of content
Expand the table of content

MimeXmlBinding Class

Represents an extensibility element added to a MimePart, an InputBinding or an OutputBinding. It specifies the schema for XML messages that are not SOAP compliant. This class cannot be inherited.

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

[XmlFormatExtensionAttribute("mimeXml", "http://schemas.xmlsoap.org/wsdl/mime/", 
	typeof(MimePart), typeof(InputBinding), typeof(OutputBinding))]
public sealed class MimeXmlBinding : ServiceDescriptionFormatExtension

The MimeXmlBinding type exposes the following members.

Public methodMimeXmlBindingInitializes a new instance of the MimeXmlBinding class.

Public propertyHandledGets or sets a value indicating whether the ServiceDescriptionFormatExtension is used by the import process when the extensibility element is imported. (Inherited from ServiceDescriptionFormatExtension.)
Public propertyParentGets the parent of the ServiceDescriptionFormatExtension. (Inherited from ServiceDescriptionFormatExtension.)
Public propertyPartGets or sets the name of the MessagePart to which the MimeXmlBinding applies.
Public propertyRequiredGets or sets a value indicating whether the ServiceDescriptionFormatExtension is necessary for the action to which it refers. (Inherited from ServiceDescriptionFormatExtension.)

Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns 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 a typical use of the MimeXmlBinding class.

using System;
using System.Web.Services.Description;
using System.Collections;
using System.Xml;

class MyXmlBinding
   public static void Main()
         ServiceDescription myDescription = 
         // Create the 'Binding' object.
         Binding myBinding = new Binding();
         // Initialize 'Name' property of 'Binding' class.
         myBinding.Name = "MimeXmlBinding_Part_3_ServiceHttpPost";
            myXmlQualifiedName = new XmlQualifiedName("s0:MimeXmlBinding_Part_3_ServiceHttpPost");
         myBinding.Type = myXmlQualifiedName;
         // Create the 'HttpBinding' object.
         HttpBinding myHttpBinding = new HttpBinding();
         // Add the 'HttpBinding' to the 'Binding'.
         // Create the 'OperationBinding' object.
         OperationBinding myOperationBinding = new OperationBinding();
         myOperationBinding.Name = "AddNumbers";
         HttpOperationBinding myHttpOperationBinding = new HttpOperationBinding();
         // Add the 'HttpOperationBinding' to 'OperationBinding'.
         // Create the 'InputBinding' object.
         InputBinding myInputBinding = new InputBinding();
         MimeContentBinding myMimeContentBinding = new MimeContentBinding();
         // Add the 'InputBinding' to 'OperationBinding'.
         myOperationBinding.Input = myInputBinding;   
         // Create an OutputBinding.
         OutputBinding myOutputBinding = new OutputBinding();
         MimeXmlBinding myMimeXmlBinding = new MimeXmlBinding();

         // Initialize the Part property of the MimeXmlBinding. 

         // Add the MimeXmlBinding to the OutputBinding.
         // Add the 'OutPutBinding' to 'OperationBinding'.
         myOperationBinding.Output = myOutputBinding; 
         // Add the 'OperationBinding' to 'Binding'.
         // Add the 'Binding' to 'BindingCollection' of 'ServiceDescription'.
         // Write the 'ServiceDescription' as a WSDL file.
         Console.WriteLine("WSDL file with name 'MimeXmlBinding_Part_3_Output_CS.wsdl' is"
                                                           + " created successfully.");
      catch(Exception e)
         Console.WriteLine( "Exception: {0}", e.Message );

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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