SoapMessage.ContentType Свойство

Определение

Получает или задает HTTP-заголовок Content-Type для запроса или ответа 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

Значение свойства

HTTP-заголовок Content-Type для запроса или ответа SOAP. По умолчанию используется значение "text/xml".

Исключения

Свойство ContentType доступно на стадии AfterSerialize или AfterDeserialize.

Примеры

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)

Комментарии

Доступ ContentType к свойству можно получить только на BeforeSerialize этапах и BeforeDeserialize ; InvalidOperationException в противном случае создается исключение .

ContentEncoding Используйте свойство вместо свойства , ContentType чтобы предоставить дополнительные сведения о кодировке сообщения SOAP.

Применяется к

См. также раздел