Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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)
public sealed class MimeContentBinding : ServiceDescriptionFormatExtension
public final class MimeContentBinding extends ServiceDescriptionFormatExtension
public final class MimeContentBinding extends ServiceDescriptionFormatExtension
Not applicable.

For more information about specifying protocols for XML Web services, see XML Web Services Using ASP.NET. 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);
      }
   }
}

import System.*;
import System.Web.Services.Description.*;

class MyMimeContentClass
{
    public static void main(String[] args)
    {
        ServiceDescription myServiceDescription = 
            ServiceDescription.Read("MimeContentSample_jsl.wsdl");

        // Get the Binding.
        Binding myBinding = myServiceDescription.get_Bindings().get_Item("b1");

        // Get the first OperationBinding.
        OperationBinding myOperationBinding = 
            myBinding.get_Operations().get_Item(0);
        OutputBinding myOutputBinding = myOperationBinding.get_Output();
        ServiceDescriptionFormatExtensionCollection 
            myServiceDescriptionFormatExtensionCollection = myOutputBinding.
            get_Extensions();

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

        // Enumerate the array and display MimeContentBinding properties.
        for (int iCtr = 0; iCtr < myMimeContentBindings.length; iCtr++) {
            MimeContentBinding myMimeContentBinding = 
                myMimeContentBindings[iCtr];
            Console.WriteLine("Type: " + myMimeContentBinding.get_Type());
            Console.WriteLine("Part: " + myMimeContentBinding.get_Part());
        }

        Console.WriteLine("Namespace: " + MimeContentBinding.Namespace);
    } //main 
} //MyMimeContentClass

System.Object
   System.Web.Services.Description.ServiceDescriptionFormatExtension
    System.Web.Services.Description.MimeContentBinding
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 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.