Home » ASP.Net, Tech Corner, Technical Interview

.NET Web Service Basics and Interview Questions

13 October 2009 No Comments Posted By:Vivek

Explain .Net Web Service?
A Web service allows you to publish an application’s function on the internet that can be accessed through another application.A very common example is the currency exchange rates available in many web sites.In most of the cases,this module will not even reside on the server on which the web site has been uploaded,but it may be using a webservice that gives the functionality.In Short, Web services are components that can be used by other applications.The definite advantage is reusability and that web services are platform and language independent as it uses a standardized XML messaging system.
ASP.NET offers easy way to develop web service.To qualify a class as a web service,you can either make the class inherit from the System.Web.Services.WebService or by qualifying the class with the [WebService] attribute.To make a method in the webservice accessible over the internet,just precede the method with a special [WebMethod] attribute in order them to work as Web Service.The web service will have an interface that describes all the methods.This is accompolished by the WSDL (Web Services Description Language).TO locate the webservice so that you can use it in your application,we make use of the UDDI (Universal Description, Discovery and Integration).
However in .Net,you would not need to worry about WSDL and UDDI.To use it in your application,you can just add the service as a web reference by supplying its URL.
What is SOAP?
SOAP- Simple Object Access Protocol is a communication protocol based on XML standards.Web Service uses SOAP for communication.Web Services can also use HTTP GET and POST,but the use of SOAP is preferred since it allows you to transmit complex data also.Http-Get and Http-Post works with name/value pair which means transferring complex object is not possible with these protocols,whereas SOAP serializes complex structure, such as ASP.NET DataSets, complex arrays, custom types and XML nodes before transmitting and thus allows exchange of complex objects between applications. SOAP uses HTTP channel to transport which makes it widely accepted protocol over the internet and dos not face the compactibility and security issues faced by a Remote Procedure call.

What is WSDL?
WSDL stands for Web Services Description Language, an XML-based language that describes Web services and how to access and locate them.

What is UDDI?
UDDI stands for Universal Description, Discovery and Integration. It is an open, Internet-based specification that offers directory service for storing information about web services.

What are the protocols a .Net Web Service uses.
In .Net, a web service is bind with three different protocols such as HTTP/POST, HTTP/GET, and SOAP,allowing client with three options to choose for communication. These protocols are included in the WSDL file that is automatically generated in .NET.

Related posts:

  1. .NET Interview Questions & Answers
  2. Dot Net Interview Questions “Only”
  3. Creating your first WebService using .NET
  4. .NET Interview Questions & Answers Part 2

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>