开发者

IParameterInspector Identify a REST Service

开发者 https://www.devze.com 2023-01-27 17:03 出处:网络
I am planning t开发者_StackOverflow社区o add a WCF Behavior to all the web services(SOAP + REST) in my solution.

I am planning t开发者_StackOverflow社区o add a WCF Behavior to all the web services(SOAP + REST) in my solution. I plan to use the same IParameterInspector implementation. Is there a way in the implementation I can identify if the request call is for a WCF service or REST Service.


I found the solution as below

//To Identify if it is a REST Service. //Action will be null in case of REST Service

bool isRestService = string.IsNullOrEmpty(OperationContext.Current.IncomingMessageHeaders.Action);

0

精彩评论

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