Interview Questions

How Web Services works?

In this let’s see how applications running in different platforms interact with each other using Web Services.

WS Server application:
Consider an application is exposing the Web Services and is acting as the server. Let’s name it as “WS Server”. The WS Server application is developed using Java. Hence, this application will make use of the SOAP engines available for Java platform i.e., for example, AXIS Soap Engine, SAAJ SOAP api’s etc. By making use of these SOAP engines, the “WS Server” application exposes few methods with Business logic which are exposed as Web Service methods by the SOAP engines. The SOAP engines will define set of procedures as how to create and deploy the Web service methods. The “WS Server” will follow their approach standards and provide the implementation with their business models.
Once the above application is deployed, a WSDL interface will be exposed in a URL by the WS Server application. This WSDL will have information about where this Web service is deployed and also provides information about the list of Web service methods available.

WS Client application:
Let’s assume an application which is developed in C++. In order to communicate with the “WS Server” application, the client application should make use of Soap engines available in C++ language (i.e., for example, GSoap component). By making use of this component, the Client application gets the WSDL from the Server through offline process and then it generates the stubs using the SOAP Engine. The stub holds the set of business methods for accessing each Web service methods available in the WS Server application. By making use of this stub, the Client application can send the SOAP request to WS Server.

Here in this approach, the WS Client application hands over the data to the Client SOAP Engine. The SOAP Engine in the Client side in turn communicates with the SOAP Engine present in the WS Server side which in turn interacts with the WS Server application internally. By this way, application running in different platform can interact with each other using SOAP protocol as the common mode of transportation.