MimeMultipartRelatedBinding Class
Represents an extensibility element added to an InputBinding or an OutputBinding, specifying the individual MIME formats for the parts of the HTTP transmission. This class cannot be inherited.
Assembly: System.Web.Services (in System.Web.Services.dll)
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 MimeMultipartRelatedBinding class.
#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^ myServicDescription = ServiceDescription::Read( "MimeMultiPartRelatedSample_cpp.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[ i ]->Name, "MimeServiceHttpPost" ) == 0 ) { OperationBindingCollection^ myOperationBindingCollection = myBindingCollection[ i ]->Operations; OutputBinding^ myOutputBinding = myOperationBindingCollection[ 0 ]->Output; ServiceDescriptionFormatExtensionCollection ^ myServiceDescriptionFormatExtensionCollection = myOutputBinding->Extensions; MimeMultipartRelatedBinding^ myMimeMultipartRelatedBinding = dynamic_cast<MimeMultipartRelatedBinding^>(myServiceDescriptionFormatExtensionCollection->Find( MimeMultipartRelatedBinding::typeid )); MimePartCollection^ myMimePartCollection = myMimeMultipartRelatedBinding->Parts; IEnumerator^ myEnum = myMimePartCollection->GetEnumerator(); while ( myEnum->MoveNext() ) { MimePart^ myMimePart = dynamic_cast<MimePart^>(myEnum->Current); Console::WriteLine( "Extension Types added to MimePart: {0}", index++ ); Console::WriteLine( "----------------------------" ); IEnumerator^ myEnum2 = myMimePart->Extensions->GetEnumerator(); while ( myEnum2->MoveNext() ) { Console::WriteLine( myEnum2->Current->GetType() ); } Console::WriteLine( "" ); } break; } }
#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;
}
}
System.Web.Services.Description::ServiceDescriptionFormatExtension
System.Web.Services.Description::MimeMultipartRelatedBinding
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.