Interview Questions Part 6 - WCF , Cache , HTPHandler , HTTPModule
Question 1 :
Which namespace does Cache object belong to ?
Answer 1 :
Cache object belongs to System.Web.Caching namespace.
Question 2 :
Explain WCF callback behaviour ?
Answer 2 :
Call back behaviour is similar to Service behaviour . They control endpoints created on client in duplex communication.
Question 3 :
Explain WCF Operation behaviour ?
Answer 3 :
Operation behaviour are scoped at Operation level. It is used for transaction flow , serialization , parameter handling.
Question 4 :
Explain WCF Endpoint behaviour ?
Answer 4 :
Endpoint behaviour are defined at endpoint level. They are used for inspecting and taking actions on messages as they come in and out of service.
Question 5 :
Explain WCF Service behaviour ?
Answer 5 :
Service behaviour run at service level and have access to all endpoints. They control instancing and transactions. They are also used for authorization and auditing.
Question 6 :
State different types of primary WCF behaviours ?
Answer 6 :
Different types of primary behaviours are as follows :
- Service Behaviour
- Endpoint Behaviour
- Operation Behaviour
- Callback Behaviour
Question 7 :
What is the impact of IsReusable property in HTTPHandler?
Answer 7 :
IsReusable property can be set to true or false.
If set to true then IHttpHandlerFactory object ( object which calls handler ) can place handler in pool and reuse it for better performance. If set to false , new instance must be created each time handler is needed.
Question 8 :
How to create custom synchronous HTTPHandler ?
Answer 8 :
Steps to create custom synchronous HTTP Handler :
- Implement IHttpHandler interface
- Implement ProcessRequest mehtod and IsReusable property
- Register handler in Web.config
- Add file name extension mapping to ASP.NET in IIS
Question 9 :
State few built in HttpHandler in ASP.NET
Answer 9 :
Few built-in httphandler in ASP.NET are :
- ASP.NET Page Handler - handler of all .aspx pages
- Web Service Handler - handler of all .asmx
- ASP.NET User Control handler - handler of all .ascx
- Trace Handler - for trace.axd
Question 10 :
How do I add public events for Httpmodule in Global.asax ?
Answer 10 :
You can add public events for Httpmodule using below syntax i.e
ModuleName_OnEventName in Global.asax .
Example
Session_OnStart ( Object sender , EventArgs e ) in Global.asax defines event handler for Start event of SessionStateModule
No comments:
Post a Comment