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)

System.Object
  System.Web.Services.Description.ServiceDescriptionFormatExtension
    System.Web.Services.Description.MimeContentBinding

[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

NameDescription
System_CAPS_pubmethodMimeContentBinding()

Initializes a new instance of the MimeContentBinding class.

NameDescription
System_CAPS_pubpropertyHandled

Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is used by the import process when the extensibility element is imported.(Inherited from ServiceDescriptionFormatExtension.)

System_CAPS_pubpropertyParent
System_CAPS_pubpropertyPart

Gets or sets the name of the MessagePart to which the MimeContentBinding applies.

System_CAPS_pubpropertyRequired

Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is necessary for the action to which it refers.(Inherited from ServiceDescriptionFormatExtension.)

System_CAPS_pubpropertyType

Gets or sets a value indicating the format of the body of the HTTP transmission.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticNamespace

Specifies the URI for the XML namespace of the MimeContentBinding class. This field is constant.

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);
      }
   }
}

.NET Framework
Available since 1.1

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

Return to top
Show:
© 2016 Microsoft