×
☰ See All Chapters

What is stub

When provider and consumer of web service are communicating, the programs which are responsible for communication are named with a special terms like stubs, skeletons and ties. Let us learn about these one by one and learn their functionalities in web service.

what-is-stub-0
 

What is stub?

A stubs is a client side (consumer) proxy object which is responsible for communicating with the provider web service. Stubs are java classes, usually generated by using wsimport tool. These java stub classes are socket programs.

What are the functionalities of stubs?

  1. When client calls the web services, it internally first calls stubs, stubs then call the actual service. 

  2. Stubs performs marshalling (Conversion of java object to xml) of the input data.  

  3. Call the actual service with the marshaled input. 

  4. Receive the response form the provider. 

  5. Unmarshal (Conversion of xml to java object) the reponse. 

  6. Give back the unmarshalled reponse object to client object. 

What is skeleton/Ties?

A skeleton/ties is a provider side proxy object which is responsible for communicating with the clients calls. Skeletons are java classes, usually generated by using wsgen tool. These java skeleton classes are socket programs.

What are the functionalities of Skeleton/Ties?

  1. When client calls the web services, it internally first calls stubs, stubs then call the actual service, it internally first calls the skeletons of the provider. 

  2. Skeltons performs unmarshalling (Conversion of xml to java object) of the input data.  

  3. Call the actual service method with the unmarshaled object. 

  4. Receive the response form the service method. 

  5. Marshal (Conversion of java object to xaml) the reponse. 

  6. Give back the marshalled reponse xml to clients. 


All Chapters
Author