Hello All, We are going to start new batch from next week. message/call or mail us for more details.

5 February 2014

.NET - Web Services Interview Questions - DotNet Brother

What is a "Web Service"?

A "Web Service" is a .NET component that replies to HTTP requests that are formatted using SOAP syntax. Web services are one of the cornerstones of the .NET initiative in that they allow a degree of interoperability among applications over the internet that was inconceivable before.

How are web services implemented in .NET?

Web services are implemented as HTTP Handlers that intercept requests to .asmx files.

What are the drawbacks of "Response Caching"?
If the method or accepts a wide range of values, response caching might be inefficient or even wasteful because a great deal of information might be stored in caching. If the method depends on other information not supplied in parameters (like user authentication or session data), it will be bypassed.
The method will be bypassed even if it needs to perform actions other than returning values (like writing to a log file)

How to overcome the limitations of response caching while providing an acceptable level of caching?

By using data caching (System.Web.Caching.Cach)

What are the protocols supported by web services built with ASP.NET to exchange data?

What are the limitations of using GET & POST to communicate with a web service?
It is less secured than SOAP.
It prevents the user from passing structures and objects as arguments
It prevents the user from passing ByRef arguments

How to make a class accessible as a web service?
-By making the class inherits from the System.Web.Services.WebService class
-By qualifying the class with the WebService attribute

 Inheriting from the WebService class is beneficiary in that it allows the class to access the ASP.NET context and other useful objects such as the session and application objects. On the other hand, qualifying the class with the WebService attribute allows for setting additional properties of the web service such as its description and namespace.
    public class TestService : System.Web.Services.WebService

How to make a method of a web service class accessible through the internet?

By qualifying the method with the WebMethod attribute.
    public string MethodName()