Live Classes: Upskill your knowledge Now!
Chat NowPublished - Tue, 06 Dec 2022
There is given frequently asked Web Services interview questions and answers that have been asked in many companies. Let's see the list of top Web Services interview questions.
The Web Service is a standard software system used for communication between two devices (client and server) over the network. Web services provide a common platform for various applications written in different languages to communicate with each other over the network.
A web service is used to communicate among various applications by using open standards such as HTML, XML, WSDL, and SOAP. You can build a Java-based web service on Solaris that is accessible from your Visual Basic program that runs on Windows. You can also use C# to develop new web services on Windows invokes from your web application that is based on Java Server Pages (JSP) and runs on Linux.
These are some of the important advantages of web services:
There are two types of web services:
Following is a list of main features of web services:
The SOAP stands for Simple Object Access Protocol. It is an XML-based protocol for accessing web services. It is platform independent and language independent. By using SOAP, you can interact with other programming language applications. More details..
These are some of the important advantages of SOAP web services:
These are some of the important disadvantages of SOAP web services:
The following list specifies the features of SOAP:
The WSDL stands for Web Services Description Language. It is an XML document containing information about web services such as method name, method parameter. The Client needs a data dictionary which contains information about all the web services with methods names and parameters list to invoke them for the web services. The Web Service Description Language bridge up this gap, by providing all necessary information to the client.
Some Important elements used in Web Services Description language are as follows:
The UDDI stands for Universal Description, Discovery and Integration. It is a XML based framework for describing, discovering and integrating web services. It contains a list of available web services. WSDL is the part of UDDI. More details..
The REST stands for Representational State Transfer. It is an architectural style. It is not a protocol like SOAP. More details..
These are some of the important advantages of RESTful web services:
No. | SOAP | REST |
---|---|---|
1) | SOAP is a protocol. | REST is an architectural style. |
2) | SOAP stands for Simple Object Access Protocol. | REST stands for Representational State Transfer. |
3) | SOAP can't use REST because it is a protocol. | REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP. |
4) | SOAP uses services interfaces to expose the business logic. | REST uses URI to expose business logic. |
5) | SOAP defines standards to be strictly followed. | REST does not define too much standards like SOAP. |
6) | SOAP permits XML data format only. | REST permits different data format such as Plain text, HTML, XML, JSON. |
SOA stands for Service Oriented Architecture. It is a design pattern to provide services to other application through protocol.
The tools used to test web services are:
In Web service, an XML is used to tag the data, format the data.
WSDL is used in web service to describe the availability of service.
The Web services facilitate various applications to communicate with each other and share data and services among themselves. Other applications can also use the web services. For example, a VB or .NET application can communicate with a Java web services and vice versa. Web services are used to make the application platform and technology independent.
A consumer of a web service is not tied to that web service directly. The web service interface can change over time without compromising the client's ability to interact with the service. A tightly coupled system implies that the client and server logic are closely tied to one another, implying that if one interface changes, the other must be updated. Adopting a loosely coupled architecture tends to make software systems more manageable and facilitates simpler integration between different systems.
Using XML eliminates any networking, operating system, or platform binding. So Web Services based applications are highly interoperable application at their core level.
Synchronicity is used to bind the client to the execution of the service. In synchronous invocations, the client blocks and waits for the service to complete its operation before continuing. On the other hand, synchronous operations facilitate a client to invoke a service and then execute different functions.
The Service Transport Layer is used to transport messages between applications.
This layer includes Hypertext Transport Protocol (HTTP), Simple Mail Transfer Protocol (SMTP), File Transfer Protocol (FTP), and newer protocols like Blocks Extensible Exchange Protocol (BEEP).
The Service Description layer is used to describe the public interface to a specific web service. Currently, service description is handled via the Web Service Description Language (WSDL).
The Service Discovery layer is used for centralizing services into a universal registry and providing easy publish/find functionality.
Currently, service discovery is handled via Universal Description, Discovery, and Integration (UDDI).
The Remote procedure calls refer to the calls made to the methods which are hosted by related web service.
The SOAP message refers to the data sent to the application from web services. SOAP message is an XML document which is sent through web services to provide data to the client application written in any programming language.
SOAP message sends via using hypertext transfer protocol.
The <Envelope> element is used as the root element of every SOAP message.
The Root element is known as the first element in the XML Document.
The envelope, in turn, separated into two parts. One is the header part and second is the body part. The header contains the routing data which stores the source and destination address of the client. So the body includes the actual data.
The web services consist of four layers, as mentioned below:
Service transport:
This layer is the first layer in the web services protocol stack used in transporting XML files between various clients applications. Protocols used in the layer is as follows:
XML Messaging:
This layer is the second layer in the web services protocol stack based on XML model where messages are encoded in common XML format which can be understandable to other client applications. This layer includes the following protocols:
Service Description:
This layer provides the service description to the public interface like the location of web service, Available functions, And the data types for XML messaging. This layer only includes one language:
Service Discovery:
This layer in the Web Services protocol stack is used to publish or finding web services over the web. This layer includes:
UDDI (Universal Description, Discovery, and integration).
The web service framework includes three different layers.
The roles of these layers are:
The Service Provider uses the interface named as ?Publish? interface of Service Registry to make the existing web services available to client applications. With all the information provided by the service registry, service requestor able to find or invoke services.
The RPC is Remote Procedure Call. It is the method used for calling a procedure or function available on any remote computer on the web.
XML-RPC refers to a simple protocol used to perform RPCs by using XML messaging. It is an excellent tool for connecting different environments and also establishing connections between wide varieties of computers.
The BEEP stands for Blocks Extensible Exchange Protocol. BEEP is an alternative to HTTP and FTP. BEEP is determined as building new protocols for the variety of applications such as instant messaging, network management, file transfer. It is termed as new Internet Engineering Task Force (IETF) which is layered directly over TCP.
Some of the Build-in features of BEEP protocol are listed below:
The requirement for accessing web services from any application is that should support XML-based request and response. Hence there is no need to install any app for accessing web services.
The UDDI uses the language known as WSDL (Web Service Description Language).
Enlisted below are some common HTTP methods along with their functions that are supported by RESTful web services.
These are the steps involved in accessing a web service:
Communication protocol refers to the protocols which were used to transmit information over the web. By using Transport protocols, applications from the different background can quickly communicate with each other without knowing the inside functioning of the various systems. HTTP (Hyper-Text Transfer Protocol) can be used to implement a SOAP message whereas FTP (File Transfer Protocol) can be used as the reliable transport mechanism. SMTP and BEEP can also be used for transport mechanism.
SOAP message is not tied to any protocol. It can use any of the open Transport protocol.
The terms "Platform independent" and "Diverse Application" were related to each other because XML-RPC uses HTTP for transporting SOAP messages over the web. The HTTP is a universal standard protocol for exchanging information on the Web. Hence, it leads to Cross Platform support/ Platform independent. So because it is Platform independent, it leads to the diverse application capable of accessing the web services.
The role of a Web Service provider is to implement web service and make it available to the web service requestor/ consumer.
The role of Web Service Requestor / Consumer is to utilize the pre-existing web service provided by the Web Service Provider/ Publisher. Web Service Requestor/ Consumer request the Web Service provider for the information by sending a SOAP message to the Web Service provider. Then in-Turn Web Service Publisher sends the requested information back to the requestor in the form of a SOAP message.
Here is the example of a Web Service Provider:
As the name suggests Web Service Provider provides the web services to the various application irrespective of their background, and Web Service Requestor/ Consumer as the name suggests is the requestor for the web services.
Fri, 16 Jun 2023
Fri, 16 Jun 2023
Fri, 16 Jun 2023
Write a public review