MimeTextBinding Class
Represents an extensibility element added to an InputBinding, an OutputBinding, or a MimePart, specifying the text patterns for which to search the HTTP transmission. This class cannot be inherited.
System.Web.Services.Description.ServiceDescriptionFormatExtension
System.Web.Services.Description.MimeTextBinding
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in System.Web.Services.dll)
[XmlFormatExtensionAttribute("text", "http://microsoft.com/wsdl/mime/textMatching/", typeof(InputBinding), typeof(OutputBinding), typeof(MimePart))] [XmlFormatExtensionPrefixAttribute("tm", "http://microsoft.com/wsdl/mime/textMatching/")] public sealed class MimeTextBinding : ServiceDescriptionFormatExtension
The MimeTextBinding type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Handled | Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is used by the import process when the extensibility element is imported. (Inherited from ServiceDescriptionFormatExtension.) |
![]() | Matches | Gets the collection of MIME text patterns for which the HTTP transmission is searched. |
![]() | Parent | Gets the parent of the ServiceDescriptionFormatExtension. (Inherited from ServiceDescriptionFormatExtension.) |
![]() | Required | Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is necessary for the action to which it refers. (Inherited from ServiceDescriptionFormatExtension.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
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/.
using System; using System.Web.Services.Description; using System.Collections; using System.Xml; class MyTextBinding { public static void Main() { try { ServiceDescription myServiceDescription = ServiceDescription.Read("MimeText_Binding_Match_8_Input_CS.wsdl"); // Create a Binding. Binding myBinding = new Binding(); // Initialize the Name property of the Binding. myBinding.Name = "MimeText_Binding_MatchServiceHttpPost"; XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:MimeText_Binding_MatchServiceHttpPost"); myBinding.Type = myXmlQualifiedName; // Create an HttpBinding. HttpBinding myHttpBinding = new HttpBinding(); myHttpBinding.Verb="POST"; // Add the HttpBinding to the Binding. myBinding.Extensions.Add(myHttpBinding); // Create an OperationBinding. OperationBinding myOperationBinding = new OperationBinding(); myOperationBinding.Name = "AddNumbers"; HttpOperationBinding myHttpOperationBinding = new HttpOperationBinding(); myHttpOperationBinding.Location="/AddNumbers"; // Add the HttpOperationBinding to the OperationBinding. myOperationBinding.Extensions.Add(myHttpOperationBinding); // Create an InputBinding. InputBinding myInputBinding = new InputBinding(); MimeContentBinding postMimeContentbinding = new MimeContentBinding(); postMimeContentbinding.Type = "application/x-www-form-urlencoded"; myInputBinding.Extensions.Add(postMimeContentbinding); // Add the InputBinding to the OperationBinding. myOperationBinding.Input = myInputBinding; // <Snippet5> // Create an OutputBinding. OutputBinding myOutputBinding = new OutputBinding(); // Create a MimeTextBinding. MimeTextBinding myMimeTextBinding = new MimeTextBinding(); // Create a MimeTextMatch. MimeTextMatch myMimeTextMatch = new MimeTextMatch(); MimeTextMatchCollection myMimeTextMatchCollection ; // Initialize properties of the MimeTextMatch. myMimeTextMatch.Name = "Title"; myMimeTextMatch.Type = "*/*"; myMimeTextMatch.Pattern = "'TITLE>(.*?)<"; myMimeTextMatch.IgnoreCase = true; // Initialize a MimeTextMatchCollection. myMimeTextMatchCollection = myMimeTextBinding.Matches; // Add the MimeTextMatch to the MimeTextMatchCollection. myMimeTextMatchCollection.Add( myMimeTextMatch ); myOutputBinding.Extensions.Add( myMimeTextBinding ); // Add the OutputBinding to the OperationBinding. myOperationBinding.Output = myOutputBinding; // </Snippet5> // Add the OutputBinding to the OperationBinding. myOperationBinding.Output = myOutputBinding; // Add the OperationBinding to the Binding. myBinding.Operations.Add(myOperationBinding); // Add the Binding to the BindingCollection of the ServiceDescription. myServiceDescription.Bindings.Add(myBinding); // Write the ServiceDescription as a WSDL file. myServiceDescription.Write("MimeText_Binding_Match_8_Output_CS.wsdl"); Console.WriteLine( "WSDL file named 'MimeText_Binding_Match_8_Output_CS.wsdl' was" + " created successfully."); } catch(Exception e) { Console.WriteLine( "Exception: {0}", e.Message ); } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
