One day in a presentation I got an example of web service as a website hosted on IIS, having the user interface only for authentication purpose. Although there was some software coding part involved and I got confused that if the web service is like that then what is the difference among web service, website, and web server. During the search on the internet, found so many answers created so many confusions. For example, one confusion is like this web service is used for information exchange from one system to another but I know server to client or client to server, information exchange is also there. Another confusion – Web service may be stateful or stateless but I know that server is also available as stateful or stateless.
These all confusions was my mistakes because I haven’t tried to understand the meaning of heading word “Service”. One day, I was studying about some servers and found the definitions as- a server can offer some services and a client can access or request some services from the server. Now I got the word services here and After getting the word got the exact answer of all confusions and I am able to answer the web service definition as “web service is a piece of software code used to fulfill the communication between Server-Client model or model where information exchange is required from one system to another. Now understand the things in details – Suppose we have a Java Servlet program for authentication and calculation. And the program containing three different parts.
1. .html part – this part contains the information, which we have to exchange from one point to another. Means the User Interface (Web browser page) part is written in HTML language and the user can enter the authentication credentials on the web page and can view the calculation on the web page after compilation and executions of this HTML code.
2. .java part – this page contains the methods used in web services as get, post, delete, etc.
3. .xml part - As the extension suggest .xml, this page is written in XML language and used to configure servlet. Means map the Java class, package, HTML page, URL, etc.
Now see the things in a graphical manner.