This documentation is archived and is not being maintained.

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", "",  _
	GetType(MimePart), GetType(InputBinding), GetType(OutputBinding))> _
Public NotInheritable Class MimeXmlBinding _
	Inherits ServiceDescriptionFormatExtension
Dim instance As MimeXmlBinding

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

The following example demonstrates a typical use of the MimeXmlBinding class.

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

Class MyXmlBinding

   Public Shared Sub Main()
         Dim myDescription As ServiceDescription = ServiceDescription.Read _
         ' Create the 'Binding' object. 
         Dim myBinding As New Binding()
         ' Initialize 'Name' property of 'Binding' class.
         myBinding.Name = "MimeXmlBinding_Part_3_ServiceHttpPost" 
         Dim myXmlQualifiedName As New XmlQualifiedName("s0:MimeXmlBinding_Part_3_ServiceHttpPost")
         myBinding.Type = myXmlQualifiedName
         ' Create the 'HttpBinding' object. 
         Dim myHttpBinding As New HttpBinding()
         myHttpBinding.Verb = "POST" 
         ' Add the 'HttpBinding' to the 'Binding'.
         ' Create the 'OperationBinding' object. 
         Dim myOperationBinding As New OperationBinding()
         myOperationBinding.Name = "AddNumbers" 
         Dim myHttpOperationBinding As New HttpOperationBinding()
         myHttpOperationBinding.Location = "/AddNumbers" 
         ' Add the 'HttpOperationBinding' to 'OperationBinding'.
         ' Create the 'InputBinding' object. 
         Dim myInputBinding As New InputBinding()
         Dim myMimeContentBinding As New MimeContentBinding()
         myMimeContentBinding.Type = "application/x-www-form-urlencoded"
         ' Add the 'InputBinding' to 'OperationBinding'.
         myOperationBinding.Input = myInputBinding
         ' Create an OutputBinding. 
         Dim myOutputBinding As New OutputBinding()
         Dim myMimeXmlBinding As New MimeXmlBinding()

         ' Initialize the Part property of the MimeXmlBinding. 
         myMimeXmlBinding.Part = "Body" 

         ' 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_VB.wsdl' is" + _
                                                                     " created successfully.")
      Catch e As Exception
         Console.WriteLine("Exception: {0}", e.Message)
      End Try 
   End Sub 'Main
End Class 'MyXmlBinding
#using <mscorlib.dll>
#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>
using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Collections;
using namespace System::Xml;

int main()
      ServiceDescription* myDescription =
      // Create the 'Binding' object.
      Binding* myBinding = new Binding();
      // Initialize 'Name' property of 'Binding' class.
      myBinding->Name = S"MimeXmlBinding_Part_3_ServiceHttpPost";
      XmlQualifiedName*myXmlQualifiedName = 
         new XmlQualifiedName(S"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 = S"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(S"WSDL file with name 'MimeXmlBinding_Part_3_Output_CS.wsdl' is"
         S" created successfully.");
   catch(Exception* e)
      Console::WriteLine( S"Exception: {0}", e->Message );

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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0