开发者

Getting HttpStatus from WCF Rest Client

As i've mentioned in topic. I have WCF Rest Service, and ASP.NET MVC3 client. In ASP's controller i'm using

IMyService serviceClient = new WebChannelFactory<IMyService>().CreateChannel();

to create client (channel) for my service. Is there any way to attach to this channel and get HttpStatusCode for each response from WebService? Btw should I close channel after each request-response? or it could be opened for next EndUser requests via ASP.NET MVC3 app?

I'm setting HttpStatusCode in webService through

WebOperationContext.Current.OutgoingResponse.StatusCode = <HttpStatusCode>;

And i'd like to check it in MVC3 app a开发者_运维技巧nd show proper hint.

EDIT: Nevermind. I've found answers.

http://msdn.microsoft.com/en-us/magazine/cc163302.aspx


AnswerLink

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜