Are you a candidate? Complete list of Web Services interview questions ๐Ÿ‘‡

Index

General

  1. How does a web service work?
  2. Give me an example of real web service.
  3. Define XML โ€“ RPC.
  4. Define SOAP.
  5. What are the advantages of web services?
  6. What are the different types of web services?
  7. What are the main features of web services?
  8. What is SOAP?
  9. What are the advantages of SOAP web services?
  10. What are the disadvantages of SOAP web services?
  11. What are the main features of SOAP?
  12. What is WSDL?
  13. What is UDDI?
  14. What is RESTful web services?
  15. What are the advantages of RESTful web services?
  16. What is SOA?
  17. What tools are used to test web services?
  18. What is the advantage of XML in web service?
  19. What is the usage of WSDL in a web service?
  20. What is Interoperability in Web services?
  21. Explain the loosely coupled architecture of web services.
  22. How you define web service protocol stack?
  23. What are the advantages of having XML based Web services?
  24. What do you mean by synchronicity?
  25. What is the usage of Service Transport Layer in Web service protocol stack?
  26. What is the usage of Service Description layer in Web Service Protocol Stack?
  27. What is the usage of Service Discovery layer in Web Service Protocol Stack?
  28. What is a remote procedure call (RPC)?
  29. What is meant by SOAP message?
  30. What is the need of <Envelope> element in the SOAP document?
  31. Explain web service protocol stack and its layers?
  32. Explain web service architecture?
  33. What is XML-RPC?
  34. Explain BEEP?
  35. What are the requirements to access a Web Service?
  36. Which language does UDDI use?
  37. Explain different HTTP methods supported by RESTful web services.
  38. What are the steps involved in accessing a web service?
  39. How many Communication protocols can be used to implement a SOAP message? Is SOAP messages are tied to any protocol?
  40. How are the terms "Platform independent" and "Diverse Application" are related to each other in the context of XML-RPC?
  41. Explain the role of web service provider/ Publisher.
  42. Explain the role of web service requestor/ consumer.
  43. Define Entrust Identification Service.
  44. Define Entrust Entitlements Service.
  45. Define Entrust Privacy Service.
  46. What do you mean by PKI?
  47. Explain what is UDDI, DISCO and WSDL?
  48. Explain what is JAXR?
  49. Explain what is JAXM messaging models?
  50. Explain what does the JAXR architecture consist of?
  51. Mention what are the usual XML APIs?
  52. Explain what is Push parsing and Pull parsing.
  53. Explain what is Stax?
  54. Explain what is JAVA web services? What are the methods to create web services?
  55. Mention the JAXB binding framework?
  56. Mention what are the types of validation can a JAXB client can perform?
  57. How is a SOAP message is structured?
  58. Explain few disadvantages of Response Caching?
  59. What is the alternate solution to Response Caching?
  60. What is the use of Accept and Content-Type Headers in HTTP Request?
  61. Name important annotations used in JAX-WS API?
  62. What is use of javax.xml.ws.Endpoint class?
  63. What is purpose of a URI in REST based webservices?
  64. What is the difference between encryption, encoding, and hashing?


The Questions
0. How does a web service work? โ†‘

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.

1. Give me an example of real web service. โ†‘

One example of web services is IBM Web Services browser. You can get it from IBM Alphaworks site. This browser shows various demos related to web services. Basically web services can be used with the help of SOAP, WSDL, and UDDI . All these, provide a plug-and-play interface for using web services such as stock-quote service, a traffic-report service, weather service etc.

2. Define XML โ€“ RPC. โ†‘

It is a protocol that makes use of XML messages to do Remote Procedure Calls.

3. Define SOAP. โ†‘

SOAP is an XML based protocol to transfer between computers.

4. What are the advantages of web services? โ†‘

These are some of the important advantages of web services:

Interoperability: With the help of web services, an application can communicate with other application developed in any language. Reusability: We can expose the web service so that other applications can use it. Modularity: With the help of web service, we can create a service for a specific task such as tax calculation. A Standard protocol for every application program: Web services use standard protocol so that all the client applications written in different languages can understand it. This Standard protocol helps in achieving cross-platform. Cheaper cost for communication: Web services uses SOAP over HTTP so that anybody can use existing internet for using web services.

5. What are the different types of web services? โ†‘

There are two types of web services:

SOAP - It is an XML-based protocol for accessing web services. RESTful - It is an architectural style, not a protocol.

6. What are the main features of web services? โ†‘

Following is a list of main features of web services:

It is available over the Internet or private (intranet) networks. It uses a standardized XML messaging system. It is not tied to any one operating system or programming language. It is self-describing via a common XML grammar. It is discoverable via a simple find mechanism.

7. What is SOAP? โ†‘

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.

8. What are the advantages of SOAP web services? โ†‘

These are some of the important advantages of SOAP web services:

WS Security - SOAP defines its security known as WS Security. Language Independent - Its web services can be written in any programming language Platform Independent - Its web services can be executed on any platform.

9. What are the disadvantages of SOAP web services? โ†‘

These are some of the important disadvantages of SOAP web services:

Slow - It uses XML format that must be parsed to be read and defines many standards that must be followed while developing the SOAP applications. So it is slow and consumes more bandwidth and resource. WSDL Dependent - It uses WSDL and doesn't have any other mechanism to discover the service.

10. What are the main features of SOAP? โ†‘

The following list specifies the features of SOAP:

SOAP is a communication protocol. SOAP communicates between applications. SOAP is a format for sending messages. SOAP is designed to communicate via Internet. SOAP is platform independent. SOAP is language independent. SOAP is simple and extensible. SOAP allows you to get around firewalls. SOAP developed as a W3C standard.

11. What is WSDL? โ†‘

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 message element in WSDL is used to define all different data elements for each operation performed by the web service.: The port type element is used to determine the operation which can be performed by the web service. This operation can have two messages one is input and the second one is the output message.: This element contains the used protocol.

12. What is UDDI? โ†‘

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.

13. What is RESTful web services? โ†‘

The REST stands for Representational State Transfer. It is an architectural style. It is not a protocol like SOAP.

14. What are the advantages of RESTful web services? โ†‘

These are some of the important advantages of RESTful web services:

Fast - The Web Services are fast because there is no strict specification of SOAP. It consumes less bandwidth and resource. Language Independent - The web services can be written in any programming language. Platform Independent - The web services can be executed on any platform. Can use SOAP - The web services can use SOAP web services as the implementation. Allows different data format - The web service permits different data format such as Plain Text, HTML, XML, and JSON.

15. What is SOA? โ†‘

SOA stands for Service Oriented Architecture. It is a design pattern to provide services to other application through protocol.

16. What tools are used to test web services? โ†‘

The tools used to test web services are:

SoapUI tool for testing SOAP and RESTful web services Poster for firefox browser Postman extension for Chrome

17. What is the advantage of XML in web service? โ†‘

In Web service, an XML is used to tag the data, format the data.

18. What is the usage of WSDL in a web service? โ†‘

WSDL is used in web service to describe the availability of service.

19. What is Interoperability in Web services? โ†‘

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.

20. Explain the loosely coupled architecture of web services. โ†‘

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.

21. How you define web service protocol stack? โ†‘

It is basically set of various protocols that can be used to explore and execute web services. The entire stack has four layers i.e. Service Transport, XML Messaging, Service Description and Service Discovery.

22. What are the advantages of having XML based Web services? โ†‘

Using XML eliminates any networking, operating system, or platform binding. So Web Services based applications are highly interoperable application at their core level.

23. What do you mean by synchronicity? โ†‘

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.

24. What is the usage of Service Transport Layer in Web service protocol stack? โ†‘

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

25. What is the usage of Service Description layer in Web Service Protocol Stack? โ†‘

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

26. What is the usage of Service Discovery layer in Web Service Protocol Stack? โ†‘

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

27. What is a remote procedure call (RPC)? โ†‘

The Remote procedure calls refer to the calls made to the methods which are hosted by related web service.

28. What is meant by SOAP message? โ†‘

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.

29. What is the need of <Envelope> element in the SOAP document? โ†‘

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

30. Explain web service protocol stack and its layers? โ†‘

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:

HTTP (Hypertext transfer protocol) SMTP (Simple Mail Transfer Protocol) FTP (File Transfer Protocol) BEEP (Block Extensible Exchange Protocol) 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:

XML - RPC SOAP (Simple Object Access Protocol) 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:

WSDL: WSDL stands for Web Service Description 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).

31. Explain web service architecture? โ†‘

The web service framework includes three different layers.

The roles of these layers are:

Service Provider: Role of Service provider is to make the web service which makes it accessible to the client applications over the Web. Service Requestor: Service requestor refers to any consumer of web service like any client application. Client applications are written in any language contact web service for any functionality by sending XML request over the available network connection. Service Registry: Service Registry is the centralized directory System which helps to locate the web services for client applications. Used to find the existing web services, as well as developers, can also create the brand new one web service also. 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.

32. What is XML-RPC? โ†‘

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.

33. Explain BEEP? โ†‘

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:

Authentication Security Error handling Initial Handshake Protocol

34. What are the requirements to access a Web Service? โ†‘

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.

35. Which language does UDDI use? โ†‘

The UDDI uses the language known as WSDL (Web Service Description Language).

36. Explain different HTTP methods supported by RESTful web services. โ†‘

Enlisted below are some common HTTP methods along with their functions that are supported by RESTful web services.

GET: Read-only access to the resource. PUT: Creation of new resource. DELETE: Removal of a resource. POST: Update of an existing resource. OPTIONS: Get supported operations on the resource. HEAD: Returns HTTP header only, no body.

37. What are the steps involved in accessing a web service? โ†‘

These are the steps involved in accessing a web service:

Client application bundled the information and into a SOAP message. SOAP message sends to the server as a body of Hyper-Text markup language using POST method. Web service unpacks the SOAP message and converts it into a command understandable by the application. Application processes the information and in turn bundled the info and send it back to the client as a SOAP message. A Client then unpacks the SOAP message to obtain the results.

38. How many Communication protocols can be used to implement a SOAP message? Is SOAP messages are tied to any protocol? โ†‘

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.

39. How are the terms "Platform independent" and "Diverse Application" are related to each other in the context of XML-RPC? โ†‘

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.

40. Explain the role of web service provider/ Publisher. โ†‘

The role of a Web Service provider is to implement web service and make it available to the web service requestor/ consumer.

41. Explain the role of 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.

42. Define Entrust Identification Service. โ†‘

Entrust Identification Service comes from the Entrust Security Transaction Platform. This platform allows companies to control the identities that are trusted to perform transactions for Web services transactions.

43. Define Entrust Entitlements Service. โ†‘

This service verifies entities that attempt to access a web service. For Example, the authentication service, the Entitlements Service ensures security in business operations.

44. Define Entrust Privacy Service. โ†‘

As its name implies, it deals with security and confidentiality. This service encrypts data to ensure that only concerned parties can access the data.

45. What do you mean by PKI? โ†‘

It means Public-Key Infrastructure.

46. Explain what is UDDI, DISCO and WSDL? โ†‘

UDDI: It means Universal Description, Discovery and I It is the directory that is used to publish and discover public web services DISCO: It is commonly known as discovery. It clubs common services together and exposes schemas document of the web services WSDL: It stands for web service description language (WSDL). It is used to describe web services. The description includes URL of web services, properties and methods supported by web services, data type it supports and protocol detail it supports

47. Explain what is JAXR? โ†‘

JAXR is the JAVA programming APIs for Java platform application to access and programmatically interact with various kinds of meta-data registries.

48. Explain what is JAXM messaging models? โ†‘

There are two types of messaging models for JAXM synchronous and asynchronous

Synchronous messaging model: In such type of model, client directly communicates with the source. In this, the client will send the request and waits. Asynchronous messaging model: In this model, client directs the message to the messaging provider and returns back. Messaging provider then executes the routing of the message to the end source.

49. Explain what does the JAXR architecture consist of? โ†‘

JAXR architecture is consists of a JAXR client and JAXR provider.

JAXR client: It is a client program which uses the JAXR API to use a registry through a JAXR provider JAXR provider: It is an implementation of the JAXR API that provide access to a particular registry provider or to a class of registry providers that are built on a common speicifications.

50. Mention what are the usual XML APIs? โ†‘

The usual XML APIs includes

DOM based or Tree based APIs: The whole document is read into memory as a tree structure for random availability by calling application Event based APIs: The application registers to get events as entities are encountered within the source document

51. Explain what is Push parsing and Pull parsing. โ†‘

Pull Parsing: Streaming pull parsing is referred to a programming model in which a client application calls methods on an XML parsing library, when it needed to communicate with an XML infoset- which means the client will only gets XML data when it is asked for Push Parsing: In Push Parsing, the parser pushes parsing events or XML data to the application. In push model, the parser got the hold over the parsing process and the parser calls the implemented handler methods.

52. Explain what is Stax? โ†‘

Stax stands for Streaming API for XML; it is an API to read and write XML documents, originating from the JAVA programming language.

53. Explain what is JAVA web services? What are the methods to create web services? โ†‘

Java webservices is developed to build and deploy basic web service on JAVA platform.

To create a web services, there are two approaches that are adopted

Top-down approach Top-up approach

54. Mention the JAXB binding framework? โ†‘

JAXB binding framework is available in three Java Packages

xml.bind: This package defines abstract classes and interfaces that are used directly with content classes xml.bind.util: This package contains utility classes that may be availed by client applications to manage marshalling, unmarshalling and validation events xml.bind.helper: This helper package gives partial implementations for some of the javax.xml.bind interfaces. These APIs are not to be directly used by applications using JAXB architecture

55. Mention what are the types of validation can a JAXB client can perform? โ†‘

There are two types of JAXB client validation that a JAXB can perform

Unmarshal Time Validation On-Demand Validation

56. How is a SOAP message is structured? โ†‘

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

57. Explain few disadvantages of Response Caching? โ†‘

Response Caching is useless or incompetent when method accepts extensive amount of values because caching means to store lot of information. Also, if the method depends on external source of information, and that are not provided within the parameters then such methods are bypassed.

58. What is the alternate solution to Response Caching? โ†‘

One can use Data Caching (System.Web.Caching.Cach) instead of Response Caching.

59. What is the use of Accept and Content-Type Headers in HTTP Request? โ†‘

These are important headers in Restful web services. Accept headers tells web service what kind of response client is accepting, so if a web service is capable of sending response in XML and JSON format and client sends Accept header as โ€œapplication/xmlโ€ then XML response will be sent. For Accept header โ€œapplication/jsonโ€, server will send the JSON response.

Content-Type header is used to tell server what is the format of data being sent in the request. If Content-Type header is โ€œapplication/xmlโ€ then server will try to parse it as XML data. This header is useful in HTTP Post and Put requests.

60. Name important annotations used in JAX-WS API? โ†‘

Some of the important annotations used in JAX-WS API are:

@WebService @SOAPBinding @WebMethod

61. What is use of javax.xml.ws.Endpoint class? โ†‘

Endpoint class provides useful methods to create endpoint and publish existing implementation as web service. This comes handy in testing web services before making further changes to deploy it on actual server.

62. What is purpose of a URI in REST based webservices? โ†‘

URI stands for Uniform Resource Identifier. Each resource in REST architecture is identified by its URI. Purpose of an URI is to locate a resource(s) on the server hosting the web service.

A URI is of following format:

:////

63. What is the difference between encryption, encoding, and hashing? โ†‘

Encryption, encoding and hashing are techniques used for converting the format of data.

Encryption is used for changing plain text into cipher text so that only authorized entities can understand it. Encryption deals with keys which are used to encrypt and decrypt the data. These keys are used to transform a simple text into a cypher text and the vice versa. Encoding is used for changing the data into a special format which makes it usable by external processes. Unlike encryption, the intention of encoding is not related to security. The message is encoded by using an algorithm or scheme. In hashing, the data is converted to a message digest or hash, which is usually a number generated from a string of text. Hashing is not reversible as encryption and encoding. The data is converted to a message digest or hash, which is usually a number generated from a string of text. These digests are important as one can easily match the hash of sent and received messages to ensure that both are the same and no tempering is done with the data.