ServiceHealthBehavior.AddHttpProperty(Message, HttpStatusCode, Boolean) 方法
定义
设置响应消息的内容类型和 HTTP 状态代码。Sets the content type and the HTTP status code for the response message.
protected:
static void AddHttpProperty(System::ServiceModel::Channels::Message ^ message, System::Net::HttpStatusCode status, bool isXml);
protected static void AddHttpProperty (System.ServiceModel.Channels.Message message, System.Net.HttpStatusCode status, bool isXml);
static member AddHttpProperty : System.ServiceModel.Channels.Message * System.Net.HttpStatusCode * bool -> unit
Protected Shared Sub AddHttpProperty (message As Message, status As HttpStatusCode, isXml As Boolean)
参数
- message
- Message
回复消息。The reply message.
- status
- HttpStatusCode
HTTP 状态代码。The HTTP status code.
- isXml
- Boolean
定义要写入到消息的 标头类型。Defines the type of header to write to the message. 如果 true, 为 text/xml 内容类型;否则 为 text/sml。If true, the is text/xml content type; otherwise, the is text/sml.
例外
message 为 null。message is null.