Basics of SOAP Webservice in Java
Posted by Anurag Jain* Filled under keyword soap,web service,xml
What is a Webservice ?
A webservice can be considered as a functionality offered by a third party which you may utilize in your own application.
1) SOAP based
2) REST based
Here we are mainly focusing on SOAP based method of calling webservice.
Common Terms :
1)The WSDL is simply xml file
2)You can think of WSDL as a Java interface. In similar fashion to an interface, WSDL also consist of all function definition which the service provider is offering.
3)Client gets this WSDL file and from this file only client comes to know about the services/functions being offered.
4)The service providers keep there WSDL into a common directory called UDDI
5)WSDL can be generated automatically using editor like netbeans.UDDI
1)It is short for Universal description discovery and integration
2)Suppose you make a web service and its corresponding WSDL. Now your client needs to have these WSDL to access the services offered.
3)But how will the client find your WSDL. For that either you need to advertise which is really time taking and costly too.
4)Second and easy option is to place it in a central directory where people can search your webservice.
5)This central repository is called UDDI. The service provider need to register their webservice on UDDISOAP
1)SOAP is just a xml based protocol for accessing the web service.
2)You may consider it as a language which browser and server use to talk in regards to webservice
SOAP Webservice :
1)The service provider first creates a webservice and make its WSDL(containing all method and services name detail) available using either UDDI or directly approaching client
2)Now client searches his requirement through UDDI and obtain the web services offering those functionality.
3)Client chooses the webservice which fits his/her requirement and obtains the wsdl.
4)Now he/she use this WSDL to obtains the function name and then make a call to these functions.
5)Finally, the client obtains the response through the webservice.
Benefits of Webservice :
1)Code reuse, since one webservice codes are being utilized by several clients.
2)Your machine and the machine on which webservice run can be different
3)All communication is done via xml to make it language independent.Assume that webservice is made in java and your site is in .net . Now too, your .net site can easily call the java webservice.
4)Saves a lots of developer time.
In coming articles we are going to learn how to make your own webservice and call them.Hope you liked it.. :)
Please login to add your comments