I am developing one webservice using c#.It is possible intercept the client request using Filter(Using HttpModule).But how it is possible to modify the request.I can get request like this
Stream InputStrm = App.Context.Request.InputStream;
i want to decrypt the request&Set it back.How can i do this??
It depends on the web service technology you’re using. If you’re using Web API or MVC, you use an
ActionFilter. If you’re using asmx, you use aSoapExtension. If you’re using WCF, you have various extension points. If it’s just a web request, anHttpModulecan apply a filter by sayingHttpContext.Current.Response.Filter = new SomeFilter( HttpContext.Current.Response.Filter )whereSomeFilteris a class likepublic class SomeFilter : Stream {. Request.Filter should work the same way. http://www.15seconds.com/issue/020417.htm is an old article, but shows a bit about these Response.Filter classes.