Saturday, January 23, 2010

Web Services - How does it work and where to use ?

Web Service has been the new buzz word in the past few years. In this post we will explore the basic elements of it and where it can be applied.

Consider this scenario a JAVA application running in a server and has an access to a stock price data base, where the recent stock prices are updated and you have a stand alone .NET stand alone application running in your computer from which you want to access the stock prices and display it in your computer. Remember you cannot be provided access to their database. So what is the solution ???

You face 2 problems

  • You dont have access to their database
  • The application that has access to the database is totally a different platform
How do you overcome such a situation? .. The answer is webservice.
If the a JAVA method that could fetch the data is exposed to the outside world that listens to the incoming requests and sends back the requested data that would be perfect isn't it?..

WebService uses HTTP protocol to send the request and response in SOAP (Simple Object Access Protocol) format.

There should be a contract to access the webservice this is provided by WSDL -Web Services Definition Language, it is also a XML file containing the method names and their return types and lot more. To learn more about webservice visit this page.

No comments: