How does a web service work?
A web service is exposed to the internet through a web server, and offers specific services in the form of a “contract” to the clients which will consume it. For example, say I run a web service which calculates a simple arithmetic problem. The contract I have for the service states that a client must submit a “firstNumber” value, a “secondNumber” value, and an “operationSign” (e.g. +, -, /, *) and then uses these to calculate a value and return the result. The web service will take the input parameters sent in a client request, verify that the parameters are appropriate according to the contract, perform whatever calculation is expected, then return the result to the client.