MimeContentBinding.Type Property
.NET Framework 3.0
Gets or sets a value indicating the format of the body of the HTTP transmission.
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 String get_Type () /** @property */ public void set_Type (String value)
public function get Type () : String public function set Type (value : String)
Not applicable.
Property Value
A string indicating the format of the body of the HTTP transmission. The default value is an empty string ("").The Web Services Description Language (WSDL) specification defines bindings for several MIME types, including text/xml, multipart/related, and application/x-www-form-urlencoded, although any MIME type can be used. The wildcard character (*) can also be used. For example, the string "text/*" would represent all text types. If the value of this property is not set, the MimeContentBinding specifies all MIME types.
For more information about WSDL, see the specification at http://www.w3.org/TR/wsdl/.
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 ); }
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());
}
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: