MimeTextBinding Classe
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Représente un élément d'extensibilité ajouté à InputBinding, OutputBinding ou MimePart, spécifiant les modèles de texte à rechercher dans la transmission HTTP. Cette classe ne peut pas être héritée.
public ref class MimeTextBinding sealed : System::Web::Services::Description::ServiceDescriptionFormatExtension
[System.Web.Services.Configuration.XmlFormatExtension("text", "http://microsoft.com/wsdl/mime/textMatching/", typeof(System.Web.Services.Description.InputBinding), typeof(System.Web.Services.Description.OutputBinding), typeof(System.Web.Services.Description.MimePart))]
[System.Web.Services.Configuration.XmlFormatExtensionPrefix("tm", "http://microsoft.com/wsdl/mime/textMatching/")]
public sealed class MimeTextBinding : System.Web.Services.Description.ServiceDescriptionFormatExtension
[<System.Web.Services.Configuration.XmlFormatExtension("text", "http://microsoft.com/wsdl/mime/textMatching/", typeof(System.Web.Services.Description.InputBinding), typeof(System.Web.Services.Description.OutputBinding), typeof(System.Web.Services.Description.MimePart))>]
[<System.Web.Services.Configuration.XmlFormatExtensionPrefix("tm", "http://microsoft.com/wsdl/mime/textMatching/")>]
type MimeTextBinding = class
inherit ServiceDescriptionFormatExtension
Public NotInheritable Class MimeTextBinding
Inherits ServiceDescriptionFormatExtension
- Héritage
- Attributs
Exemples
#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>
using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Collections;
using namespace System::Xml;
int main()
{
try
{
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimeText_Binding_Match_8_Input_CPP.wsdl" );
// Create a Binding.
Binding^ myBinding = gcnew Binding;
// Initialize the Name property of the Binding.
myBinding->Name = "MimeText_Binding_MatchServiceHttpPost";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MimeText_Binding_MatchServiceHttpPost" );
myBinding->Type = myXmlQualifiedName;
// Create an HttpBinding.
HttpBinding^ myHttpBinding = gcnew HttpBinding;
myHttpBinding->Verb = "POST";
// Add the HttpBinding to the Binding.
myBinding->Extensions->Add( myHttpBinding );
// Create an OperationBinding.
OperationBinding^ myOperationBinding = gcnew OperationBinding;
myOperationBinding->Name = "AddNumbers";
HttpOperationBinding^ myHttpOperationBinding = gcnew HttpOperationBinding;
myHttpOperationBinding->Location = "/AddNumbers";
// Add the HttpOperationBinding to the OperationBinding.
myOperationBinding->Extensions->Add( myHttpOperationBinding );
// Create an InputBinding.
InputBinding^ myInputBinding = gcnew InputBinding;
MimeContentBinding^ postMimeContentbinding = gcnew MimeContentBinding;
postMimeContentbinding->Type = "application/x-www-form-urlencoded";
myInputBinding->Extensions->Add( postMimeContentbinding );
// Add the InputBinding to the OperationBinding.
myOperationBinding->Input = myInputBinding;
// Create an OutputBinding.
OutputBinding^ myOutputBinding = gcnew OutputBinding;
// Create a MimeTextBinding.
MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding;
// Create a MimeTextMatch.
MimeTextMatch^ myMimeTextMatch = gcnew 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;
// 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_CPP.wsdl" );
Console::WriteLine( "WSDL file named 'MimeText_Binding_Match_8_Output_CPP.wsdl' was"
" created successfully." );
}
catch ( Exception^ e )
{
Console::WriteLine( "Exception: {0}", e->Message );
}
}
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;
// 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;
// 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 );
}
}
}
Imports System.Web.Services.Description
Imports System.Collections
Imports System.Xml
Class MyTextBinding
Public Shared Sub Main()
Try
Dim myServiceDescription As ServiceDescription = _
ServiceDescription.Read("MimeText_Binding_Match_8_Input_vb.wsdl")
' Create a Binding.
Dim myBinding As New Binding()
' Initialize the Name property of the Binding.
myBinding.Name = "MimeText_Binding_MatchServiceHttpPost"
Dim myXmlQualifiedName As _
New XmlQualifiedName("s0:MimeText_Binding_MatchServiceHttpPost")
myBinding.Type = myXmlQualifiedName
' Create an HttpBinding.
Dim myHttpBinding As New HttpBinding()
myHttpBinding.Verb = "POST"
' Add the HttpBinding to the Binding.
myBinding.Extensions.Add(myHttpBinding)
' Create an OperationBinding.
Dim myOperationBinding As New OperationBinding()
myOperationBinding.Name = "AddNumbers"
Dim myHttpOperationBinding As New HttpOperationBinding()
myHttpOperationBinding.Location = "/AddNumbers"
' Add the HttpOperationBinding to the OperationBinding.
myOperationBinding.Extensions.Add(myHttpOperationBinding)
' Create an InputBinding.
Dim myInputBinding As New InputBinding()
Dim postMimeContentbinding As New MimeContentBinding()
postMimeContentbinding.Type = "application/x-www-form-urlencoded"
myInputBinding.Extensions.Add(postMimeContentbinding)
' Add the InputBinding to the OperationBinding.
myOperationBinding.Input = myInputBinding
' Create an OutputBinding.
Dim myOutputBinding As New OutputBinding()
' Create a MimeTextBinding.
Dim myMimeTextBinding As New MimeTextBinding()
' Create a MimeTextMatch.
Dim myMimeTextMatch As New MimeTextMatch()
Dim myMimeTextMatchCollection As MimeTextMatchCollection
' 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
' 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_vb.wsdl")
Console.WriteLine("WSDL file named " & _
"'MimeText_Binding_Match_8_Output_vb.wsdl' was" & _
" created successfully.")
Catch e As Exception
Console.WriteLine("Exception: {0}", e.Message)
End Try
End Sub
End Class
Remarques
Pour plus d’informations sur la spécification de protocoles pour les services Web XML, consultez Services Web XML à l’aide de ASP.NET. Pour plus d’informations sur WSDL (Web Services Description Language), consultez la spécification WSDL .
Constructeurs
MimeTextBinding() |
Initialise une nouvelle instance de la classe MimeTextBinding. |
Champs
Namespace |
Spécifie l'URI pour l'espace de noms XML de la classe MimeTextBinding. Ce champ est constant. |
Propriétés
Handled |
Obtient ou définit une valeur indiquant si ServiceDescriptionFormatExtension est utilisé par le processus d'importation lors de l'importation de l'élément d'extensibilité. (Hérité de ServiceDescriptionFormatExtension) |
Matches |
Obtient la collection de modèles de texte MIME à rechercher dans la transmission HTTP. |
Parent |
Obtient le parent du ServiceDescriptionFormatExtension. (Hérité de ServiceDescriptionFormatExtension) |
Required |
Obtient ou définit une valeur indiquant si ServiceDescriptionFormatExtension est nécessaire pour l'action à laquelle il fait référence. (Hérité de ServiceDescriptionFormatExtension) |
Méthodes
Equals(Object) |
Détermine si l'objet spécifié est égal à l'objet actuel. (Hérité de Object) |
GetHashCode() |
Fait office de fonction de hachage par défaut. (Hérité de Object) |
GetType() |
Obtient le Type de l'instance actuelle. (Hérité de Object) |
MemberwiseClone() |
Crée une copie superficielle du Object actuel. (Hérité de Object) |
ToString() |
Retourne une chaîne qui représente l'objet actuel. (Hérité de Object) |