MimeMultipartRelatedBinding クラス

InputBinding または OutputBinding に追加された機能拡張要素を表し、HTTP 伝送の各部分の個別の MIME 形式を指定します。このクラスは継承できません。

この型のすべてのメンバの一覧については、MimeMultipartRelatedBinding メンバ を参照してください。

System.Object
   System.Web.Services.Description.ServiceDescriptionFormatExtension
      System.Web.Services.Description.MimeMultipartRelatedBinding

NotInheritable Public Class MimeMultipartRelatedBinding
   Inherits ServiceDescriptionFormatExtension
[C#]
public sealed class MimeMultipartRelatedBinding :
   ServiceDescriptionFormatExtension
[C++]
public __gc __sealed class MimeMultipartRelatedBinding : public
   ServiceDescriptionFormatExtension
[JScript]
public class MimeMultipartRelatedBinding extends
   ServiceDescriptionFormatExtension

スレッドセーフ

この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。

解説

XML Web サービスのプロトコルの指定については、「 ASP.NET を使用した XML Web サービスの作成 」を参照してください。WSDL (Web Services Description Language) の詳細については、http://www.w3.org/TR/wsdl/ の仕様を参照してください。

使用例

[Visual Basic, C#, C++] MimeMultipartRelatedBinding クラスによって公開されるプロパティとメソッドを使用する例を次に示します。

 
Imports System
Imports System.Web.Services.Description

Namespace MimeContentBinding_work
    
   Class MyMimeContentClass
      
      Shared Sub Main()
        Dim myServicDescription As ServiceDescription = _
            ServiceDescription.Read("MimeMultiPartRelatedSample_vb.wsdl")

        ' Get the binding collection.
         Dim myBindingCollection As BindingCollection = _
            myServicDescription.Bindings
         Dim index As Integer = 0
         Dim i As Integer
         For i = 0 To myBindingCollection.Count - 1
            ' Get the collection for MimeServiceHttpPost.
            If myBindingCollection(i).Name = "MimeServiceHttpPost" Then
               Dim myOperationBindingCollection As _
                  OperationBindingCollection = myBindingCollection(i).Operations
               Dim myOutputBinding As OutputBinding = _
                  myOperationBindingCollection(0).Output
               Dim myServiceDescriptionFormatExtensionCollection As _
                  ServiceDescriptionFormatExtensionCollection = _
                  myOutputBinding.Extensions
               Dim myMimeMultipartRelatedBinding As _
                  MimeMultipartRelatedBinding = _ 
                  CType(myServiceDescriptionFormatExtensionCollection.Find( _
                  GetType(MimeMultipartRelatedBinding)), _
                  MimeMultipartRelatedBinding)
               Dim myMimePartCollection As MimePartCollection = _
                  myMimeMultipartRelatedBinding.Parts
               Dim myMimePart As MimePart
               For Each myMimePart In  myMimePartCollection
                  Console.WriteLine("Extension Types added to MimePart: " & _
                     index.ToString()) 
                  Console.WriteLine("----------------------------")
                  index = index + 1
                  Dim myExtension As Object
                  For Each myExtension In myMimePart.Extensions
                     Console.WriteLine(myExtension.GetType())
                  Next myExtension
                  Console.WriteLine()
               Next myMimePart
               Exit For
            End If
         Next i
      End Sub 'Main 
   End Class 'MyMimeContentClass
End Namespace 'MimeContentBinding_work

[C#] 
using System;
using System.Web.Services.Description;

namespace MimeContentBinding_work
{
   class MyMimeContentClass
   {
      static void Main()
      {
         ServiceDescription  myServicDescription = 
            ServiceDescription.Read("MimeMultiPartRelatedSample_cs.wsdl");

         // Get the binding collection.
         BindingCollection myBindingCollection = myServicDescription.Bindings;
         int index =0;
         for (int i= 0; i < myBindingCollection.Count;i++)
         {
            // Get the collection for MimeServiceHttpPost.
            if( myBindingCollection[i].Name == "MimeServiceHttpPost")
            {
               OperationBindingCollection myOperationBindingCollection = 
                  myBindingCollection[i].Operations;
               OutputBinding myOutputBinding = 
                  myOperationBindingCollection[0].Output;
               ServiceDescriptionFormatExtensionCollection 
                  myServiceDescriptionFormatExtensionCollection = 
                  myOutputBinding.Extensions;
               MimeMultipartRelatedBinding myMimeMultipartRelatedBinding  = 
                  (MimeMultipartRelatedBinding)
                  myServiceDescriptionFormatExtensionCollection.Find(
                  typeof(MimeMultipartRelatedBinding));
               MimePartCollection myMimePartCollection = 
                  myMimeMultipartRelatedBinding.Parts;
               foreach( MimePart myMimePart in myMimePartCollection)
               {
                  Console.WriteLine("Extension types added to MimePart: " + 
                     index ++);
                  Console.WriteLine ("----------------------------");
                  foreach(object myExtension in myMimePart.Extensions)
                     Console.WriteLine(myExtension.GetType()); 
                  Console.WriteLine();
               }
               break;
            }
         }
      }
   }
}

[C++] 
#using <mscorlib.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 * myServicDescription =  
      ServiceDescription::Read(S"MimeMultiPartRelatedSample_cs.wsdl");

   // Get the binding collection.
   BindingCollection * myBindingCollection = myServicDescription->Bindings;
   int index =0;
   for (int i =  0; i < myBindingCollection->Count ; i++)

      // Get the collection for MimeServiceHttpPost.
      if (String::Compare(myBindingCollection->Item[i]->Name, 
         S"MimeServiceHttpPost") == 0)
      {
         OperationBindingCollection * myOperationBindingCollection = 
            myBindingCollection->Item[i]->Operations;
         OutputBinding * myOutputBinding = 
            myOperationBindingCollection->Item[0]->Output;
         ServiceDescriptionFormatExtensionCollection * 
            myServiceDescriptionFormatExtensionCollection = 
            myOutputBinding->Extensions;
         MimeMultipartRelatedBinding * myMimeMultipartRelatedBinding  =
            dynamic_cast<MimeMultipartRelatedBinding*>(
            myServiceDescriptionFormatExtensionCollection->Find(
            __typeof(MimeMultipartRelatedBinding)));
         MimePartCollection * myMimePartCollection = 
            myMimeMultipartRelatedBinding->Parts;
         IEnumerator* myEnum = myMimePartCollection->GetEnumerator();
         while ( myEnum->MoveNext() )
         {
            MimePart* myMimePart = dynamic_cast<MimePart*>(myEnum->Current);
            Console::WriteLine(S"Extension Types added to MimePart: {0}",
               __box(index++));
            Console::WriteLine (S"----------------------------");
            IEnumerator* myEnum2 = myMimePart->Extensions->GetEnumerator();
            while (myEnum2->MoveNext())
            {
               Console::WriteLine(myEnum2->Current->GetType());
            }
            Console::WriteLine(S"");
         }
         break;
      }
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

名前空間: System.Web.Services.Description

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: System.Web.Services (System.Web.Services.dll 内)

参照

MimeMultipartRelatedBinding メンバ | System.Web.Services.Description 名前空間