Compartilhar via


MimeContentBinding Classe

Definição

Representa um elemento de extensibilidade adicionado a um InputBinding ou um OutputBinding dentro de um serviço Web XML, especificando o formato MIME para o corpo da transmissão HTTP. Essa classe não pode ser herdada.

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
Herança
Atributos

Exemplos

O exemplo a seguir demonstra o uso das propriedades e dos métodos expostos pela MimeContentBinding classe .

#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

Comentários

Para obter mais informações sobre como especificar protocolos para serviços Web XML, consulte Serviços Web XML usando ASP.NET. Para obter mais informações sobre o WSDL (Linguagem de Descrição dos Serviços Web), consulte a especificação do WSDL .

Construtores

MimeContentBinding()

Inicializa uma nova instância da classe MimeContentBinding.

Campos

Namespace

Especifica o URI para o namespace de XML da classe MimeContentBinding. Este campo é constante.

Propriedades

Handled

Obtém ou define um valor que indica se o ServiceDescriptionFormatExtension é usado pelo processo de importação quando o elemento de extensibilidade é importado.

(Herdado de ServiceDescriptionFormatExtension)
Parent

Obtém o pai do ServiceDescriptionFormatExtension.

(Herdado de ServiceDescriptionFormatExtension)
Part

Obtém ou define nome do MimeContentBinding ao qual o MessagePart se aplica.

Required

Obtém ou define um valor que indica se o ServiceDescriptionFormatExtension é necessário para a ação à qual ele se refere.

(Herdado de ServiceDescriptionFormatExtension)
Type

Obtém ou define um valor que indica o formato do corpo da transmissão HTTP.

Métodos

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetHashCode()

Serve como a função de hash padrão.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.

(Herdado de Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.

(Herdado de Object)

Aplica-se a