Last post Mar 01, 2014 05:37 AM by nidabp
Feb 21, 2014 11:19 PM|nidabp|LINK
I am trying to intercept a web service call using a httpmodule. The httpmodule is getting called but the web method does not. I tried using the BeginRequest, PreRequestHandlerExecute and AcquireRequestState events to intercept the call. But whichever
event I used, the web method never seem to get invoked. When I unregistered the httpmodule, the web method gets executed. What are the events that are called before the invocation of a web method? The problem seems to be there only while I call the web method. The
httpmodule events are getting invoked when I access an aspx page in the same website and the page loads fine. What are life cycle events for an asmx web service call?
Feb 24, 2014 01:27 AM|Fuxiang Zhang - MSFT|LINK
Thank you post the issue to our forum.
WebServices are a kind of ASP.NET application, so its lifecyle is very similar to any ASP.NET application.
Asmx web service request follows the ASP.NET Application Life Cycle.
When you send a request to the .asmx file and the relevant IHttpHandler is executed.
Asp.net Built-in HTTP Handlers[web service handler (*.asmx)] is the default HTTP handler for Web service pages created as .asmx files in ASP.NET.
You can also intercept a web service call from the global.asax like below event.
Hope this helps, thanks.
Mar 01, 2014 05:37 AM|nidabp|LINK
Thanks for the reply. I have sorted out the issue. The issue was with something else. I was reading the request stream in the httpmodule using a stream reader and it was closing the stream, which is making it unavailable for the web method. used a byte
array to read the stream and it resolved the issue.