Web Services Interview Question and Answers


Q) Define Web Service?

A web service is a kind of software that is accessible on the Internet. It makes use of the XML messaging system and offers an easy to understand, interface for the end users.

Q) Can you tell few benefits of web services?
Interoperability, Code Reuse, etc.

Q) What are RESTful Web Services ?

Ans. REST or Representational State Transfer is a flexible architecture style for creating web services that recommends the following guidelines -

1. http for client server communication,
2. XML / JSON as formatiing language ,
3. Simple URI as address for the services and,
4. stateless communication.

Q)  Which markup languages can be used in restful web services ?

Ans. XML and JSON ( Javascript Object Notation ).

Q) Why Web services use HTTP as the communication protocol ?

Ans. With the advent of Internet, HTTP is the most preferred way of communication. Most of the clients ( web thin client , web thick clients , mobile apps )  are designed to communicate using http only. Web Services using http makes them accessible from vast variety of client applications.

Q) What are the HTTP methods used in Rest Services ?

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

Q) Difference between PUT and POST ?
Ans. PUT puts a file or resource at a specific URI, and exactly at that URI. If there's already a file or resource at that URI, PUT replaces that file or resource. If there is no file or resource there, PUT creates one.

POST sends data to a specific URI and expects the resource at that URI to handle the request. The web server at this point can determine what to do with the data in the context of the specified resource.
Q) What happens if RestFull resources are accessed by multiple clients ? do you need to make it thread-safe?
Ans: 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.

Q) Define SOAP?
SOAP is an XML based protocol to transfer between computers.

Q) Define WSDL?

It means Web Services Description Language. It is basically the service description layer in the web service protocol stock. The Service Description layer describes the user interface to a web service.

Q) What kind of security is needed for web services?

The security level for web services should be more than that of what we say Secure Socket Layer (SSL). This level of security can be only achieved from Entrust Secure Transaction Platform. Web services need this level of security to ensure reliable transactions and secure confidential information .

Q) Is there any special application required to access web service?

No, you don’t need to install any special application to access web service. You can access web service from any application that supports XML based object request and response.

Q) Can you name few free and commercial implementations for web services?

The implementations I know are Apache SOAP, JAX-WS Reference Implementation, JAX-RS Reference Implementation, Metro, Apache CXF, MS.NET and Java 6.

Q) Name the various communication channels in web service?

Web service is integrated with three protocols such as HTTP/POST, HTTP/GET, and SOAP. It provides three different communication channels to clients. Client can choose any communication method as per requirements.

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

Q) How a SOAP message is structured?

A SOAP message is consists of SOAP Envelope, SOAP Headers, and SOAP Body.

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

Q) What’s different in RESTful web services?

The RESTful web services contains no contract or WSDL file.

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

Comments