English 中文(简体)
2. 测验仪
原标题:IParameterInspector Identify a REST Service
  • 时间:2010-12-01 20:52:36
  •  标签:
  • wcf

I am planning to 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.

问题回答

我认为解决办法如下:

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

bool is Restservice = string.IsNullOrEmpty (OperationContext.Current. InnewMessage Headers.Action);





相关问题
WCF DataMember Serializing questions

Ok, so I was part way through the long winded process of creating DTOs for sending my model over the wire and I don t feel like I m going down the right route. My issue is that most of the entities ...

Access WCF service on same server

I have a .NET website with a WCF service. How do I access the current operations context of my service? One possible work around is to just make a call to the service within the app...but that seems ...

WCF binding error

So I got into work early today and got the latest from source control. When I try to launch our ASP.NET application, I get this exception: "The binding at system.serviceModel/bindings/wsHttpBinding ...

The service operation requires a transaction to be flowed

I am facing strange issue with our WCF service. The same code was working fine until recently we added more OperationContracts(Web Methods). We have common 3 tier architecture. DAL (WCF) BLL Web ...

热门标签