开发者

RESTful WCF Service: Sending back user confirmation

开发者 https://www.devze.com 2023-03-24 19:28 出处:网络
In my Rest WCF project I am saving data to DB. My question is when the user sends data to my wcf service,

In my Rest WCF project I am saving data to DB. My question is when the user sends data to my wcf service, I need to validate the data and if there is any error how can I inform it back to the user? And once data is s开发者_如何学Cuccessfully saved to Database , I need to send a confirmation to the user saying "Data successfully saved". How can I do this. Thanks in advance for your help.


Use the HttpStatusCode:

WebOperationContext context = WebOperationContext.Current;
context.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.OK;
0

精彩评论

暂无评论...
验证码 换一张
取 消