SoapMessage.ContentType Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the HTTP Content-Type
of the SOAP request or SOAP response.
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
Property Value
The HTTP Content-Type
of the SOAP request or SOAP response. The default is "text/xml".
Exceptions
ContentType is accessed AfterSerialize or AfterDeserialize stages.
Examples
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)
Remarks
The ContentType property can only be accessed in the BeforeSerialize and BeforeDeserialize stages; otherwise, an InvalidOperationException is thrown.
Use the ContentEncoding property, instead of the ContentType property to provide supplementary information about the encoding of a SOAP message.
Applies to
See also
.NET