2010-12-01 72 views
0

我打算在我的解決方案中爲所有Web服務(SOAP + REST)添加WCF行爲。 我打算使用相同的IParameterInspector實現。 在實現中,我可以確定請求調用是否針對WCF服務或REST服務。IParameterInspector識別REST服務

回答

0

我發現溶液如下

//以識別是否它是一個REST服務。 //對於REST服務,操作將爲空

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