Compartir a través de


MimeContentBinding Clase

Definición

Representa un elemento de extensibilidad agregado a un objeto InputBinding o OutputBinding incluido en un servicio Web XML, que especifica el formato MIME del cuerpo de la transmisión HTTP. Esta clase no puede heredarse.

public ref class MimeContentBinding sealed : System::Web::Services::Description::ServiceDescriptionFormatExtension
[System.Web.Services.Configuration.XmlFormatExtension("content", "http://schemas.xmlsoap.org/wsdl/mime/", typeof(System.Web.Services.Description.MimePart), typeof(System.Web.Services.Description.InputBinding), typeof(System.Web.Services.Description.OutputBinding))]
[System.Web.Services.Configuration.XmlFormatExtensionPrefix("mime", "http://schemas.xmlsoap.org/wsdl/mime/")]
public sealed class MimeContentBinding : System.Web.Services.Description.ServiceDescriptionFormatExtension
[<System.Web.Services.Configuration.XmlFormatExtension("content", "http://schemas.xmlsoap.org/wsdl/mime/", typeof(System.Web.Services.Description.MimePart), typeof(System.Web.Services.Description.InputBinding), typeof(System.Web.Services.Description.OutputBinding))>]
[<System.Web.Services.Configuration.XmlFormatExtensionPrefix("mime", "http://schemas.xmlsoap.org/wsdl/mime/")>]
type MimeContentBinding = class
    inherit ServiceDescriptionFormatExtension
Public NotInheritable Class MimeContentBinding
Inherits ServiceDescriptionFormatExtension
Herencia
Atributos

Ejemplos

En el ejemplo siguiente se muestra el uso de las propiedades y los métodos expuestos por la MimeContentBinding clase .

#using <System.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( "MimeContentSample_cpp.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.
   array<MimeContentBinding^>^myMimeContentBindings = (array<MimeContentBinding^>^)myServiceDescriptionFormatExtensionCollection->FindAll( MimeContentBinding::typeid );

   // Enumerate the array and display MimeContentBinding properties.
   IEnumerator^ myEnum = myMimeContentBindings->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      MimeContentBinding^ myMimeContentBinding = safe_cast<MimeContentBinding^>(myEnum->Current);
      Console::WriteLine( "Type: {0}", myMimeContentBinding->Type );
      Console::WriteLine( "Part: {0}", myMimeContentBinding->Part );
   }
   Console::WriteLine( "Namespace: {0}", MimeContentBinding::Namespace );
}
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);
      }
   }
}
Imports System.Web.Services.Description

Namespace MimeContentBinding_work

   Class MyMimeContentClass
      
      Shared Sub Main()
         Dim myServiceDescription As ServiceDescription = _
            ServiceDescription.Read ("MimeContentSample_vb.wsdl")

         ' Get the Binding.
         Dim myBinding As Binding = myServiceDescription.Bindings("b1")

         ' Get the first OperationBinding.
         Dim myOperationBinding As OperationBinding = myBinding.Operations(0)
         Dim myOutputBinding As OutputBinding = myOperationBinding.Output
         Dim myServiceDescriptionFormatExtensionCollection As _
            ServiceDescriptionFormatExtensionCollection = _
            myOutputBinding.Extensions

         ' Find all MimeContentBinding objects in extensions.
         Dim myMimeContentBindings As MimeContentBinding() = _
            CType(myServiceDescriptionFormatExtensionCollection.FindAll( _
            GetType(MimeContentBinding)), MimeContentBinding())

         ' Enumerate the array and display MimeContentBinding properties.
         Dim myMimeContentBinding As MimeContentBinding
         For Each myMimeContentBinding In  myMimeContentBindings
            Console.WriteLine("Type: " & myMimeContentBinding.Type)
            Console.WriteLine("Part: " & myMimeContentBinding.Part)
         Next myMimeContentBinding
         Console.WriteLine("Namespace: " & MimeContentBinding.Namespace)
      End Sub
   End Class
End Namespace 'MimeContentBinding_work

Comentarios

Para obtener más información sobre cómo especificar protocolos para servicios web XML, vea Servicios web XML mediante ASP.NET. Para obtener más información sobre el lenguaje de descripción de servicios web (WSDL), consulte la especificación WSDL .

Constructores

MimeContentBinding()

Inicializa una nueva instancia de la clase MimeContentBinding.

Campos

Namespace

Especifica el identificador URI para el espacio de nombres XML de la clase MimeContentBinding. Este campo es constante.

Propiedades

Handled

Obtiene o establece un valor que indica si ServiceDescriptionFormatExtension se utiliza en el proceso de importación cuando se importa el elemento de extensibilidad.

(Heredado de ServiceDescriptionFormatExtension)
Parent

Obtiene el objeto principal de ServiceDescriptionFormatExtension.

(Heredado de ServiceDescriptionFormatExtension)
Part

Obtiene o establece el nombre del objeto MessagePart al que se aplica MimeContentBinding.

Required

Obtiene o establece un valor que indica si ServiceDescriptionFormatExtension es necesario para la acción a la que hace referencia.

(Heredado de ServiceDescriptionFormatExtension)
Type

Obtiene o establece un valor que indica el formato del cuerpo de la transmisión HTTP.

Métodos

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Se aplica a