MimeContentBinding Class
TOC
Collapse the table of content
Expand the table of content

MimeContentBinding Class

Represents an extensibility element added to an InputBinding or an OutputBinding within an XML Web service, specifying the MIME format for the body of the HTTP transmission. This class cannot be inherited.

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

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

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 properties and methods exposed by the MimeContentBinding class.

using System;
using System.Web.Services.Description;

namespace MimeContentBinding_work
{
   class MyMimeContentClass
   {
      static void Main()
      {
         ServiceDescription  myServiceDescription =  
            ServiceDescription.Read("MimeContentSample_cs.wsdl");

         // Get the Binding.
         Binding myBinding = myServiceDescription.Bindings["b1"];

         // Get the first OperationBinding.
         OperationBinding myOperationBinding = myBinding.Operations[0];
         OutputBinding myOutputBinding = myOperationBinding.Output;
         ServiceDescriptionFormatExtensionCollection  
            myServiceDescriptionFormatExtensionCollection = 
            myOutputBinding.Extensions;

         // Find all MimeContentBinding objects in extensions.
         MimeContentBinding[] myMimeContentBindings = (MimeContentBinding[])
            myServiceDescriptionFormatExtensionCollection.FindAll(
            typeof(MimeContentBinding));

         // Enumerate the array and display MimeContentBinding properties. 
         foreach(MimeContentBinding myMimeContentBinding in 
            myMimeContentBindings)
         {
            Console.WriteLine("Type: " + myMimeContentBinding.Type);
            Console.WriteLine("Part: " + myMimeContentBinding.Part);
         }
         Console.WriteLine("Namespace: " + MimeContentBinding.Namespace);
      }
   }
}
#using <mscorlib.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Collections;

int main() 
{
   ServiceDescription*  myServiceDescription =  
      ServiceDescription::Read(S"MimeContentSample_cpp.wsdl");

   // Get the Binding.
   Binding * myBinding = myServiceDescription->Bindings->Item[S"b1"];

   // Get the first OperationBinding.
   OperationBinding * myOperationBinding = myBinding->Operations->Item[0];
   OutputBinding * myOutputBinding = myOperationBinding->Output;
   ServiceDescriptionFormatExtensionCollection * 
      myServiceDescriptionFormatExtensionCollection = 
      myOutputBinding->Extensions;

   // Find all MimeContentBinding objects in extensions.
   MimeContentBinding* myMimeContentBindings[] = (MimeContentBinding* [])
      myServiceDescriptionFormatExtensionCollection->FindAll(
      __typeof(MimeContentBinding));

   // Enumerate the array and display MimeContentBinding properties.
   IEnumerator* myEnum = myMimeContentBindings->GetEnumerator();
   while (myEnum->MoveNext())
   {
      MimeContentBinding* myMimeContentBinding = 
         __try_cast<MimeContentBinding*>(myEnum->Current);
      Console::WriteLine(S"Type: {0}", myMimeContentBinding->Type);
      Console::WriteLine(S"Part: {0}", myMimeContentBinding->Part);
   }
   Console::WriteLine(S"Namespace: {0}", MimeContentBinding::Namespace);
}

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

Community Additions

ADD
Show:
© 2016 Microsoft