MimeMultipartRelatedBinding.Parts Property
.NET Framework 2.0
Gets the collection of extensibility elements added to the MimeMultipartRelatedBinding to specify the MIME format for the parts of the MIME message.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
/** @property */ public MimePartCollection get_Parts ()
public function get Parts () : MimePartCollection
Not applicable.
Property Value
A MimePartCollection representing extensibility elements added to the MimeMultipartRelatedBinding.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; }
ServiceDescription myServicDescription =
ServiceDescription.Read("MimeMultiPartRelatedSample_jsl.wsdl");
// Get the binding collection.
BindingCollection myBindingCollection =
myServicDescription.get_Bindings();
int index = 0;
for (int i = 0; i < myBindingCollection.get_Count(); i++) {
// Get the collection for MimeServiceHttpPost.
if (myBindingCollection.get_Item(i).get_Name().
Equals("MimeServiceHttpPost")) {
OperationBindingCollection myOperationBindingCollection =
myBindingCollection.get_Item(i).get_Operations();
OutputBinding myOutputBinding =
myOperationBindingCollection.get_Item(0).get_Output();
ServiceDescriptionFormatExtensionCollection
myServiceDescriptionFormatExtensionCollection =
myOutputBinding.get_Extensions();
MimeMultipartRelatedBinding myMimeMultipartRelatedBinding =
(MimeMultipartRelatedBinding)
myServiceDescriptionFormatExtensionCollection.
Find(MimeMultipartRelatedBinding.class.ToType());
MimePartCollection myMimePartCollection =
myMimeMultipartRelatedBinding.get_Parts();
IEnumerator objEnum1 = myMimePartCollection.GetEnumerator();
while (objEnum1.MoveNext()) {
MimePart myMimePart = (MimePart)objEnum1.get_Current();
Console.WriteLine("Extension types added to MimePart: "
+ index++);
Console.WriteLine("----------------------------");
IEnumerator objEnum2 = myMimePart.get_Extensions().
GetEnumerator();
while (objEnum2.MoveNext()) {
Object myExtension = objEnum2.get_Current();
Console.WriteLine(myExtension.GetType());
}
Console.WriteLine();
}
break;
}
}
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: