Monday, 17 March 2014

Interview Q & A on Web Services in Asp.Net(Part 2)

1.What is .Net Web Service?

Web service is the way to publish application's function on web that can be accessible to the rest of the world. Web services are the components that can be used by other applications.

2 . Define SOAP?

SOAP, Simple Object Access Protocol is a communication protocol, a way to structure data before transmitting it, is based on XML standard. It is developed to allow communication between applications of different platforms and programming languages via internet.

3.Explain the Protocols ..net web service used ?

In .Net, a web service is bind with three different protocols such as HTTP/POST, HTTP/GET, and SOAP. This allows client with three options to choose for communication.

4   What is WSDL?

WSDL is an XML-based language for locating and describing Web services.

5. What is UDDI?

UDDI is a directory service where companies can register and search for Web services.

6. What is   proxy?

It a combination of special type class and  library.

7. Who create proxy?

 Client

7. How Does it Work?

The basic Web services platform is XML + HTTP.
XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions.
The HTTP protocol is the most used Internet protocol.
Web services platform elements:
·                     SOAP (Simple Object Access Protocol)
·                     UDDI (Universal Description, Discovery and Integration)
·                     WSDL (Web Services Description Language)

9. Does the W3C support any Web service standards?

Yes

10.    What is XML-RPC?

XML-RPC is a protocol that uses XML messages to perform Remote Procedure Calls.

11.What are the different styles of Web Services used for application integration? 

 SOAP Web Service and RESTful Web Service

12.  What are the differences between both SOAP WS and RESTful WS?  

The SOAP WS supports both remote procedure call (i.e. RPC) and message oriented middle-ware (MOM) integration styles. The Restful Web Service supports only RPC integration style.

  The SOAP WS is transport protocol neutral. Supports multiple protocols like HTTP(S),  Messaging, TCP, UDP SMTP, etc. The REST is transport protocol specific. Supports only HTTP or HTTPS protocols.

13.   What  is  REST?
REST (the initials) stand for : Representational State Transfer.
REST is a service API which allows you to access services and data from various clients. To do this, you would specify a URL to some item, like a web page with xml in it, and get that item back, via an HTP ‘GET’ request, and parse and reformat the xml.
14. what is  DISCO.?
DISCO, an abbreviation of discovery, is a file that groups together a list of related web services. A company that offers web services publishes a DISCO file on its server that has links of all the web services it provides. The client requests this file to see all the available web services. This standard is useful when client already know about a company that offers web services. You can also use DISCO standard while working in local network. It is not helpful to find all web services over the internet.

15.Why to create Web Service / What is the benefit of Web Service ? 

   Web Services are easier to communicate between applications running on different platform and build on different language. It allows easy integration with other applications.

16 What are the different formats supported by REST API?

As it runs on HTTP , it will support formats supported by HTTP like HTML, JSON, AMF, IMAGE etc.

17. What is advantage of web services?
Ø      Uses open Standards and Protocols
Ø     Better code maintenance
Ø     Allows reuse of Services
Ø     Firewall Friendly

18.               what is limitations of    web services?

Ø    Can communicate using Http no other   protocol.
Ø     Security is low.

19 what is SOAPUI?

It is tool for test the webservices.

20, what is xml schema?

Xml schema is wel defined  well defined xml structure. It is w3.org standard.

21.
How are web services implemented in .NET?

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

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

·         HTTP GET
·         HTTP POST
·         SOAP

22.
Q.
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

23.
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

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



By qualifying the method with the WebMethod attribute.


25. What tools do you use to test your Web Services?

SoapUI tool for SOAP WS and the Firefox "poster" plugin for RESTFul services.

26. What happens if RestFull resources are accessed by multiple clients ? do you need to make it thread-safe?

Since a new Resource instance is created for every incoming Request there is no need to make it thread-safe or add synchronization. multiple client can safely access RestFull resources concurrently.

26.What is difference between top-down and bottom-up approach of developing web services ?

In top-down approach first WSDL document is created and than Java classes are developed based on WSDL contract, so if WSDL contract changes you got to change your Java classes while in case of bottom up approach of web service development you first create Java code and then use annotations like @WebService to specify contract or interface and WSDL field will be automatically generated from your build.

27 . Which HTTP methods are supported by RestFull web services ?
Another common REST interview questioning RESTFul web service each Resource supports GET, POST, PUT and DELETE http methods.GET is mapped to represent(), POST - acceptRepresentation(), PUT- storeRepresentation and DELET for rmeoveRepresentation.

28. How to display custom error pages using RestFull web services ?
In order to customize error you need to extend StatusService and implement getRepresentation(Status, Request, Response) method with your custom code now assign instance of your CustomStatusService to appropriate "statusService property".

29 . What are the tools used for creating RESTFull web services ?
You can use AJAX(Asynchronous JavaScript with XAML) and Direct Web Removing to consume web serives in web application. Both Eclipse and NetBeans also supported development of RESTFul services.

30.What is RESTEasy ?
RESTEasy is another REST framework introduced in JBoss Application Server. This was rather easy REST interview questions. you can answer in detail only if you have used this or working in JBoss.

31.What is differences between RESTful web services and SOAP web services ?
Though both RESTful web series and SOAP web service can operate cross platform they are architecturally different to each other, here is some of differences between REST and SOAP:

1) REST is more simple and easy to use than SOAP
2) REST uses HTTP protocol for producing or consuming web services while SOAP uses XML.
3) REST is lightweight as compared to SOAP and preferred choice in mobile devices and PDA's.
4) REST supports different format like text, JSON and XML while SOAP only support XML.
5) REST web services call can be cached to improve performance.

32. What is REST and RESTful web services ?
this is the first REST interview question on most of interviews as not everybody familiar with REST and also
start discussion based on candidates response. Anyway REST stands for REpresentational State Transfer (REST) its a relatively new concept of writing web services which enforces a stateless client server design where web services are treated as resource and can be accessed and identified by there URL unlike SOAP web services which were defined by WSDL.





No comments:

Post a Comment