MimeContentBinding Класс

Определение

Представляет элемент расширения среды, добавляемый в InputBinding или в OutputBinding веб-службы XML и задающий формат MIME для текста сообщения HTTP. Этот класс не наследуется.

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.XmlFormatExtensionPrefix("mime", "http://schemas.xmlsoap.org/wsdl/mime/")]
[System.Web.Services.Configuration.XmlFormatExtension("content", "http://schemas.xmlsoap.org/wsdl/mime/", typeof(System.Web.Services.Description.InputBinding), typeof(System.Web.Services.Description.OutputBinding))]
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
[<System.Web.Services.Configuration.XmlFormatExtensionPrefix("mime", "http://schemas.xmlsoap.org/wsdl/mime/")>]
[<System.Web.Services.Configuration.XmlFormatExtension("content", "http://schemas.xmlsoap.org/wsdl/mime/", typeof(System.Web.Services.Description.InputBinding), typeof(System.Web.Services.Description.OutputBinding))>]
type MimeContentBinding = class
    inherit ServiceDescriptionFormatExtension
Public NotInheritable Class MimeContentBinding
Inherits ServiceDescriptionFormatExtension
Наследование
Атрибуты

Примеры

В следующем примере показано использование свойств и методов, предоставляемых классом MimeContentBinding .

#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

Комментарии

Дополнительные сведения об указании протоколов для веб-служб XML см. в разделе "Веб-службы XML" с помощью ASP.NET. Дополнительные сведения о языке описания веб-служб (WSDL) см. в спецификации WSDL .

Конструкторы

MimeContentBinding()

Инициализирует новый экземпляр класса MimeContentBinding.

Поля

Namespace

Задает URI для пространства имен XML класса MimeContentBinding. Это поле является константой.

Свойства

Handled

Возвращает или задает значение, показывающее, используется ли объект ServiceDescriptionFormatExtension при импорте элемента расширения среды.

(Унаследовано от ServiceDescriptionFormatExtension)
Parent

Возвращает родительский класс класса ServiceDescriptionFormatExtension.

(Унаследовано от ServiceDescriptionFormatExtension)
Part

Возвращает или задает имя класса MessagePart, к которому применяется MimeContentBinding.

Required

Возвращает или задает значение, показывающее, является ли класс ServiceDescriptionFormatExtension необходимым для действия, к которому он относится.

(Унаследовано от ServiceDescriptionFormatExtension)
Type

Возвращает или задает значение, указывающее формат содержимого передачи HTTP.

Методы

Equals(Object)

Определяет, равен ли указанный объект текущему объекту.

(Унаследовано от Object)
GetHashCode()

Служит хэш-функцией по умолчанию.

(Унаследовано от Object)
GetType()

Возвращает объект Type для текущего экземпляра.

(Унаследовано от Object)
MemberwiseClone()

Создает неполную копию текущего объекта Object.

(Унаследовано от Object)
ToString()

Возвращает строку, представляющую текущий объект.

(Унаследовано от Object)

Применяется к