SoapMessage.ContentType Property
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
The HTTP Content-Type
of the SOAP request or SOAP response. The default is "text/xml".
ContentType is accessed AfterSerialize or AfterDeserialize stages.
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)
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.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: