Most Asked Web Services Interview Questions and Answers
Differentiate between web services, CORBA and DCOM?
Web services transfer/receive messages to/from application respectively, via HTTP protocol. It uses XML to encode data.
CORBA and DCOM transfer/receive messages to/from application respectively, via non-standard protocols such as IIOP and RPC.
Can you tell few benefits of web services?
The biggest advantage of web service is that is supported by wide variety of platforms. Moreover, in near future, web services may spread its boundary and enhance new methods that will provide ease to clients. The enhancement will not affect the clients, even if they offer old methods and parameters.
Can you name some standards used in web services?
The standards used in web services are WSDL (used to create interface definition), SOAP (used to structure data), HTTP (communication channels), DISCO (used to create discovery documents) and UDDI (used to create business registries).
Explain in brief, what DISCO is?
DISCO means discovery. It groups the list of interrelated web services. The organization that provides web services, issues a DISCO file on its server and that file contains the links of all the provided web services. This standard is good when client knows the company already. Also it can be used within a local network as well.
Explain in brief, what UDDI is?
UDDI (Universal Description, Discovery, and Integration) provides consolidated directory for web services on the internet. Clients use UDDI to find web services as per their business needs. It basically hosts the web services from various companies. In order to share web services, you need to publish it in UDDI.
Explain the .NET web services supported data types?
.Net web services uses XML-based standards to transfer/receive information. Thus, .NET web services can only works with data types known by XML schema standard. Like FileSteam, Eventlog etc. are not recognized by the XML schema standards and hence, not supported in web services.
How a .NET web service is tested?
ASP.NET uses a test page routinely, when one calls for the URL of .asmx file in any browser. This page shows complete information regarding web services.
How a .NET web service is consumed?
Since we know that web services are constructed on XML standards. Therefore, clients need to have complete understanding of XML-based messages to interchange messages. Clients can communicate with web services through .NET framework that offers proxy mechanisms. These proxy mechanisms have detailed information regarding data sharing within web services that can be easily used by the clients.
Can you name the two Microsoft solutions for distributed applications?
The two Microsoft solutions for distributed applications are .NET Web Services and .NET Remoting.
Differentiate between .NET Web Services and .NET Remoting?
As far as protocol is concerned, .NET Web Service uses HTTP, while, .NET Remoting uses any protocol i.e. TCP/HTTP/SMTP. When it comes to performance, .NET Remoting is comparatively, faster than.NET Web Service. Also, as .NET Web Services are hosted via IIS, therefore, it is far more reliable than the .NET Remoting.
Name the components to be published while deploying a Web Service?
The components that need to be published during a web service deployment are Web Application Directory, Webservice.asmx File, Webservice.Disco File, Web.Config File and Bin Directory.
What are the steps performed by the client to access a web service?
First of all a web reference to the web service is created by the client in his application. Then a proxy class is generated. After that an object of the proxy class is created and at last, the web service is accessed via that proxy object
How web services are implemented in .NET?
To implement web services in .NET, HTTP handlers are used that interrupt requests to .asmx files.
Explain few disadvantages of Response Caching?
Response Caching is useless or incompetent when method accepts extensive amount of values because caching means to store lot of information. Also, if the method depends on external source of information, and that are not provided within the parameters then such methods are bypassed.
What is the alternate solution to Response Caching?
One can use Data Caching (System.Web.Caching.Cach) instead of Response Caching.
Brief few drawbacks of using GET and POST methods to communicate with the web service?
These methods are less secure and inhibit users to pass structures and objects as arguments. Also, it doesn’t allow users to pass ByRef arguments.
How can one access a class as a web service?
To access a class as a web service, one should inherit the class from the System.Web.Services.WebService class and qualify the class with the WebService attribute
How can one access the web service class method via internet?
To access web service class method via internet, one should qualify a method with the WebMethod attribute.
How a SOAP message is structured?
A SOAP message is consists of SOAP Envelope, SOAP Headers, and SOAP Body.
Can you name different kinds of web services?
There are two types of web services in total i.e. SOAP based web service and RESTful web service.
This question is already mentioned earlier.
What’s different in RESTful web services?
The RESTful web services contains no contract or WSDL file.
Give me few reasons to use RESTful web service?
The RESTFul web services are simple to implement and test. It supports various data formats such as XML, JSON etc.