Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Name some components that are needed to be published while deploying a web service.

Answer»

COMPONENTS that are needed to be published while deploying a web SERVICE includes: 

  • Web APPLICATION Directory 
  • Webservice.asmx File 
  • Webservice.Disco File 
  • Web.Config File 
  • BIN Directory 
2.

Name three primary security issues of Web Services?

Answer»

The three primary security issues of web SERVICES include: 

3.

What are the advantages of using SOA

Answer»

Some of its advantages include:  

  • Easy to integrate. 
  • Services are platform-independent. 
  • Manage complexity so that INTEGRATION becomes more manageable. 
  • Services are easier to TEST and DEBUG
  • Easily available to any REQUESTER
4.

What are the different elements of the SOAP Document or message?

Answer»

The SOAP message is basically an ordinary XML document CONSISTS of three parts as given below: 

SOAP ENVELOPE: It is a mandatory ELEMENT that identifies XML documents as a SOAP message. It simply defines the start and the end of the message.  

SOAP Header: It is an optional element that contains header information.  

SOAP Body: It is a mandatory element that contains call and response information. It INCLUDES XML data consisting of the message that is being sent. 

The following block depicts the general structure of SOAP XML request and response: 

XML Request 

<Envelope xmlns=?http://schemas.xmlsoap.org/soap/envelop/?> <Body> <getCourseDetailRequest xmlns=?http://udemy.com/course?> <id>course1</id> <getCourseDetailRequest> </Body> </Envelope>

XML Response 

<SOAP-ENV:Envelope xmlns:SOAP-ENV=?http://schemas.xmlsoap.org/soap/envelope/?> <SOAP-ENV:Header /> <!?empty header--> <SOAP-ENV:Body> <!?body begin--> <ns2:getCourseDetailsResponse xmlns:ns2=?http://in28mi> <!--content of the response--> <ns2:course> <ns2:id>Course1</ns2:id> <ns2:name>Spring<ns2:name> <ns2:description>10 Steps</NS1:description> </ns2:course> </ns2:getCourseDetailResponse> </SOAP-ENV:Body> <!?body end--> </SOAP-ENV:Envelope>
5.

What do you mean by SOAP? Write its advantages.

Answer»

SOAP (Simple Object Access Protocol) is an XML-based protocol that is used to access web services. It is simply used to interchange data or information between two devices or computers using request and RESPONSE based on XML format over transport protocols like HTTP, SMTP, etc. 

ADVANTAGES

  • Language and Information independent. 
  • Can be WRITTEN in different programming languages or operating systems. 
  • PROVIDE data transport for web services.  
  • Can EXTEND HTTP for XML messaging. 
  • Defines and uses its own WS security. 
  • Easy to debug and eliminate firewall issues. 
6.

What are the written status codes for REST API?

Answer»

REST API generally RETURNS the FOLLOWING status codes in HTTP response:

  • 200 OK
  • 201 Created
  • 202 Accepted
  • 302 Found
  • 400 BAD Request
  • 401 Unauthorized 
  • 404 Not Found
  • 405 Method Not Allowed
  • 409 Conflict
  • 500 Internal Server ERROR
7.

Name HTTP methods that can be used with RESTful web services.

Answer»

Some of the HTTP METHODS that can be used with RESTful web services include: 

  • GET: Used to get and read a resource. 
  • POST: Used to create a new resource. 
  • PUT: Used to update existing resources. 
  • DELETE: Used to delete the resource. 
  • PATCH: Used to APPLY partial MODIFICATIONS to a resource.
8.

Explain the term statelessness with respect to RESTful web Services. Write its advantages.

Answer»

Statelessness is basically a condition or restriction where RESTful web services are not allowed to keep a client state on the SERVER as per the REST architecture. Clients are responsible to pass their context to the server. To process the client’s request, the server then further stores this context.  

ADVANTAGES 

  • No need to maintain previous interactions with clients.
  • Independent treatment of each method request.
  • Less complexity and simplified application design.

Example: Simple GET Request using NodeJS

We have the following sample data in users.json file.
Filename: users.json

{ "user1" : { "name" : "gourav", "password" : "password1", "PROFESSION" : "officer", "id": 1 }, "user2" : { "name" : "nikhil", "password" : "password2", "profession" : "teacher", "id": 2 }}

Implement our RESTful API listUsers using the following code in a server.js file.
Filename: server.js

// Requiring modulevar express = require('express');var app = express();var fs = require("fs");// Sample GET APIapp.get('/listUsers', function (req, res) { fs.readFile( __dirname + "/" + "users.json", 'utf8', function (err, data) { console.log( data ); res.end( data ); });})// Server setupvar server = app.listen(8081, function () { var host = server.address().address var port = server.address().port console.log("Example app listening at HTTP://%s:%s", host, port)})

Now open a browser and go to http://127.0.0.1:8081/listUsers,  we will get the following response:

{ "user1" : { "name" : "gourav", "password" : "password1", "profession" : "officer", "id": 1 }, "user2" : { "name" : "nikhil", "password" : "password2", "profession" : "teacher", "id": 2 }}
9.

Which protocol is used by RESTful web services?

Answer»

The protocol USED by RESTFUL WEB services is HTTP

10.

What are the advantages of RESTful web service?

Answer»

There are SEVERAL advantages of RESTful web services as given below: 

  • Platform independent. 
  • Simple and easy to implement and test. 
  • SUPPORT different FORMATS such as JSON, XML, HTML, etc. 
  • Can be written in different programming languages and executed on any platform. 
  • LIGHTWEIGHT, manageable, scalable, and reusable. 
  • Faster and provide better performance. 
  • Consume less bandwidth and resources. 
  • A lot of automation framework is available
11.

What are RESTful Web Services?

Answer»

REST (Representational State Transfer) is a stateless client-server architecture style used for developing applications that are accessible over the web. It is a type of web service whose main GOAL is to make web services more EFFECTIVE. It can be defined as the web service that USES HTTP methods for implementing the REST architecture. Unlike SOAP which is protocol-based, RESTFUL services are architecturally based. It does not contain any contract or WSDL file.  

12.

Explain the term Synchronicity.

Answer»

Synchronicity generally refers to the binding of the client to the function’s execution and it can be DONE in two ways i.e., synchronous and ASYNCHRONOUS. In Synchronous invocations, the client blocks and waits until the service complete its operation before CONTINUING its WORK. In Asynchronous invocations, clients are allowed to invoke a service and execute other FUNCTIONS.

13.

What are the different layers of the web service protocol stack?

Answer»

The implementation of web services generally depends on technologies that are often organized in a layered stack. Examining the web service protocol stack is considered as the second option for viewing the web service architecture. In simple words, it is the set of protocols that are used to explore and EXECUTE web services. Currently, the web service protocol stack has four layers as given below:

Service Transport: It is generally responsible to transport messages between applications. It basically defines technology standards for communication and allows messages or information to MOVE ACROSS the network without any difficulty. It uses HTTP, SMTP, FTP, and DEEP protocols to transfer information.  
XML Messaging: It is generally responsible to encode messages into XML format so that one can understand these messages at either end. This layer generally includes XML-RPC and SOAP.  
Service Description: It is generally responsible to describe the public interface to a SPECIFIC web service. WSDL is generally used to handle service descriptions.
Service Discovery: It is generally responsible to centralize service into a common registry and provides easy functionality for publishing or finding web services. UDDI is generally used to handle service discovery.

14.

What is a Web Service Registry?

Answer»

The web service registry is basically LIKE a ‘PHONE BOOK’ for web services. It allows client applications to be able to PUBLISH new services or can locate the already existing ones. Two widely-used registry standards are generally supported by application servers i.e., ebXML (Electronic Business using XML) and UDDI (Universal Description, Discovery, and INTEGRATION). 

15.

What is a Web service Requestor?

Answer»

Web service REQUESTOR is the client APPLICATION that requests for web service to use it. Its main PURPOSE is to use an existing web service by opening a network connection and SENDING an XML request. In SIMPLE words, they are consumers of the web service. 

16.

What is a Web Service Provider?

Answer»

Web service generally creates web services and provides ACCESS to the CLIENT application who wants it. Its main purpose is to implement the service and make it available on the Internet so that client applications can USE it whenever required. In simple words, it is a platform that creates and HOSTS web services. 

17.

Explain web service Architecture.

Answer»

Every framework requires some type of architecture to ensure that the entire framework works perfectly as desired, the same goes for web SERVICES. Web service architecture is used to assist the developer with steps and procedures that are essential to complete the creation. Web service architecture includes THREE distinct roles i.e., service provider, service requester, and service registry. It also includes three different operations that include:  

Publish (PUBLICATION of Service Descriptions): A service description NEEDS to be published so that the service requestor can locate and have access to it. It can be published anywhere depending upon the requirements of the application. 

Find (Finding of Services Descriptions): A service description is RETRIEVED directly by a service requestor. The requestor consults the broker to locate a web service that is already published. 

Bind (Invoking of Service based on Service Description): Every service needs to be invoked. To locate, contact, and invoke the service, the service requestor initiates the interaction with the service at runtime using details of binding in the service description.  

18.

Name the language that is commonly used by UDDI.

Answer»

The LANGUAGE commonly used by UDDI is WSDL (WEB SERVICE Description Language). 

19.

What are the important features of UDDI?

Answer»

Some important features of UDDI include: 

  • Platform independent 
  • USES WSDL for describing interfaces to web services 
  • Can communicate through SOAP, JAVA RMI, and CORBA Protocol 
  • The delineation between interface and implementation 
  • Neutral in terms of protocols 
20.

What do you mean by UDDI?

Answer»

UDDI (Universal Description, Discovery, and INTEGRATION) is a directory service used for describing, publishing, and FINDING web SERVICES. It is also used for CREATING BUSINESS registries. It is based on a set of web standards including HTTP, XML, SOAP, WSDL, XML Schema. Its main goal is to streamline digital transactions and e-commerce among company systems.

21.

What are the features of XML-RPC?

Answer»

There are various features of XML-RPC that includes: 

  • PLATFORM independent 
  • Allows diverse APPLICATIONS to communicate 
  • Considered as the easiest and SIMPLEST WAY to get started with web services 
  • Uses XML to ENCODE its calls and HTTP as the transport protocol 
22.

What is XML-RPC?

Answer»

XML-RPC (Remote PROCEDURE call) is considered the most basic and SIMPLEST XML-based protocol to exchange DATA among different devices on a network. It uses HTTP as a transport protocol for quickly and easily transferring the information or data between TWO devices. XML-RPC can also be used with different programming languages such as Perl, Java, Python, C, C++, PHP, etc.

23.

Name the tools that are used to test web services.

Answer»

There are VARIOUS tools USED to test web service as GIVEN below: 

24.

Write the difference between API and Web services.

Answer»

API (Application Programming Interface): It acts as an interface between two devices so that they can communicate with each other without any user intervention. Some of its FEATURES include customizable, easy integration with GUI, time effective, language-independent, etc. All APIs are not web services. 
Web Service: It FACILITATES interaction between two devices over a network. They are widely used for exchanging data among systems or applications. Some of its features include loosely coupled, supports DOCUMENT exchange, interoperability, extensibility, etc. All Web services are APIs. 

APIWeb Service
It can be online or offline.It must use a network.
They are lightweight architecture.They REQUIRE SOAP to SEND and receive network data therefore, are not lightweight architectures.
It can use any design style or protocol.It can only use SOAP but sometimes UDDI, XML, RPC, and REST also.
It supports HTTP/HTTPS protocol and also supports XML and JSON.It supports HTTP protocol and also supports XML.
It doesn’t require any network for its operation.It requires a network for its operation.
They are open source and are used for XML.They are not open source and are used to understand JSON (JavaScript Object Notation). 
25.

What are the different components of Web Services?

Answer»

There are VARIOUS components of web services as GIVEN below: 

  • SOAP (Simple Object ACCESS Protocol) 
  • UDDI (Universal Description, Discovery, and Integration) 
  • WSDL (Web Services Description Language) 
  • RDF (Resource Description Framework) 
  • XML (EXTENSIBLE Markup Language) 
26.

What are the important features of Web services?

Answer»

Some of the important features of web services include: 

  • Used to standardized XML messaging system. 
  • Not tied to any one programming language or any operating system. 
  • Discoverable via a SIMPLE find mechanism. 
  • Available over the internet or private networks. 
  • Supports loosely coupled connections between systems. 
  • Can be synchronous or asynchronous. 
  • Supports the transparent exchange of DATA to facilitate business integration. 
  • Supports communication among different apps with HTML, XML, WSDL, SOAP, etc. 
  • Supports RPC (REMOTE Procedure Calls).
27.

Explain different types of Web Services.

Answer»

There are basically two TYPES of web services: 

SOAP (Simple Object Access Protocol) Web Services: It is also REFERRED to as transport-independent messaging protocol whose main purpose is to TRANSFER a message, and is based on XML protocol. 

RESTful (Representational State Transfer) Web Services: It is developed to fulfill the shortcomings of SOAP and to make the web services more EFFECTIVE