Compartir por


SoapMessage.ContentType Propiedad

Definición

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

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.

Se aplica a

Consulte también