Sdílet prostřednictvím


SoapMessage.ContentType Vlastnost

Definice

Získá nebo nastaví HTTP Content-Type požadavku SOAP nebo odpovědi 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

Hodnota vlastnosti

String

HTTP Content-Type požadavku SOAP nebo odpovědi SOAP. Výchozí hodnota je text/xml.

Výjimky

Příklady

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)

Poznámky

K ContentType vlastnosti lze přistupovat pouze ve BeforeSerialize fázích a BeforeDeserialize v opačném případě InvalidOperationException je vyvolána.

ContentEncoding Použijte vlastnost místo ContentType vlastnosti k poskytnutí doplňujících informací o kódování zprávy SOAP.

Platí pro

Viz také