SoapMessage.ContentType Propriété
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.
Obtient ou définit le protocole HTTP Content-Type de la requête SOAP ou de la réponse SOAP.
public:
property System::String ^ ContentType { System::String ^ get(); void set(System::String ^ value); };
public string ContentType { get; set; }
member this.ContentType : string with get, set
Public Property ContentType As String
Valeur de propriété
Content-Type HTTP de la requête SOAP ou de la réponse SOAP. La valeur par défaut est « text/xml ».
Exceptions
ContentType est accessible AfterSerialize ou AfterDeserialize par étapes.
Exemples
myStreamWriter->WriteLine( "The contents of HTTP Content-type header is:" );
myStreamWriter->WriteLine( "\t{0}", message->ContentType );
myStreamWriter.WriteLine("The contents of HTTP Content-type header is:");
myStreamWriter.WriteLine("\t" + message.ContentType);
myStreamWriter.WriteLine("The contents of HTTP Content-type header is:")
myStreamWriter.WriteLine(ControlChars.Tab & message.ContentType)
Remarques
La ContentType propriété est accessible uniquement aux étapes et BeforeDeserialize aux BeforeSerialize étapes ; sinon, une InvalidOperationException valeur est levée.
Utilisez la ContentEncoding propriété, au lieu de la ContentType propriété pour fournir des informations supplémentaires sur l’encodage d’un message SOAP.