SoapMessage.ContentType Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece el HTTP Content-Type de la solicitud SOAP o la respuesta 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
Valor de propiedad
HTTP Content-Type de la solicitud SOAP o la respuesta SOAP. El valor predeterminado es "text/xml".
Excepciones
ContentType se accede a AfterSerialize ellas o AfterDeserialize a las fases.
Ejemplos
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)
Comentarios
Solo ContentType se puede tener acceso a la propiedad en las BeforeSerialize fases y BeforeDeserialize ; de lo contrario, se produce una InvalidOperationException excepción .
Utilice la ContentEncoding propiedad , en lugar de la ContentType propiedad para proporcionar información complementaria sobre la codificación de un mensaje SOAP.