MimeContentBinding Class
.NET Framework 2.0
Represents an extensibility element added to an InputBinding or an OutputBinding within an XML Web service, specifying the MIME format for the body of the HTTP transmission. This class cannot be inherited.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
For more information about specifying protocols for XML Web services, see XML Web Services Using ASP.NET. 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 MimeContentBinding 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^ 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 ); }
import System.*;
import System.Web.Services.Description.*;
class MyMimeContentClass
{
public static void main(String[] args)
{
ServiceDescription myServiceDescription =
ServiceDescription.Read("MimeContentSample_jsl.wsdl");
// Get the Binding.
Binding myBinding = myServiceDescription.get_Bindings().get_Item("b1");
// Get the first OperationBinding.
OperationBinding myOperationBinding =
myBinding.get_Operations().get_Item(0);
OutputBinding myOutputBinding = myOperationBinding.get_Output();
ServiceDescriptionFormatExtensionCollection
myServiceDescriptionFormatExtensionCollection = myOutputBinding.
get_Extensions();
// Find all MimeContentBinding objects in extensions.
MimeContentBinding myMimeContentBindings[] =
(MimeContentBinding[])myServiceDescriptionFormatExtensionCollection.
FindAll(MimeContentBinding.class.ToType());
// Enumerate the array and display MimeContentBinding properties.
for (int iCtr = 0; iCtr < myMimeContentBindings.length; iCtr++) {
MimeContentBinding myMimeContentBinding =
myMimeContentBindings[iCtr];
Console.WriteLine("Type: " + myMimeContentBinding.get_Type());
Console.WriteLine("Part: " + myMimeContentBinding.get_Part());
}
Console.WriteLine("Namespace: " + MimeContentBinding.Namespace);
} //main
} //MyMimeContentClass
System.Object
System.Web.Services.Description.ServiceDescriptionFormatExtension
System.Web.Services.Description.MimeContentBinding
System.Web.Services.Description.ServiceDescriptionFormatExtension
System.Web.Services.Description.MimeContentBinding
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: