Reputation: 553
I'm trying to understand
All I am aware of is that they are encoded in SOAP/XML and they are language independent, meaning I could write a program in Java and create a webservice and have any user with any program to call it. But I am looking to further understand the low level details.
Upvotes: 0
Views: 220
Reputation: 8161
As the name suggest Web Service
typically is a service over web ( or over a network ). The main purpose of this is to communication between two devices. A very dumb example could be suppose you own a site and in your site's user profile page you want to show current temperature of the day. In a very easiest way what you can do is call a web service with some specific parameters ( your location/user credentials or whatever ) and get the temperature in response. Now you are free to do anything with it. So instead of handling the temperature calculation your self you rely on this web service to do the job for you, here you actually act as a client
while the one who is providing you the service becomes the provider
.
In general it uses a standardized XML based messaging system that follow the SOAP standard. So in a broader sense its like you being a client invoke an web service by sending an XML (formatted) message and receive a corresponding XML response.
Now XML
, being the main means of communicating between you (client) and the provider, none of you really care about the implementation details of each other. So while you have written all your client side code in Java the provider could very possibly used a different language e.g C# or whatever. So the client and the server are totally independent.
Often the contract between these two (client-server) are defined in a file called WSDL (Web Service Description Language) however there are other approaches also such as REST-compliant Web services. There are plenty of material available over internet which should help you get started very quickly.
In Java here is a very simple tutorial of creating and consuming web services using Net Beans IDE.
Upvotes: 4