Поделиться через


SoapMessage.ContentType Свойство

Определение

Возвращает или задает HTTP-запрос Content-Type SOAP или ответ 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 или ответа 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.

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

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