Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes how does stub work ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "how does stub work ?" Watch "how does stub work ?" New topic
Author

how does stub work ?

laxmikant upadhyay
Greenhorn

Joined: Aug 24, 2012
Posts: 14
hi,
i have created a simple web service and client using wsdltojava tool of Axis2 with available wsdl file . At the client side i just invoked the method of stub, that's it.. and it work fine.
But i don't understand how it identifies the endpoint?
How the connection is being created to server?
how actually marshaling is being done ??
please put some light on it.
J Dirksen
Author
Greenhorn

Joined: Sep 04, 2012
Posts: 13
That's the advantage of using WSDL2Java. In the WSDL the endpoint where the service is running on is defined. So if you generate a client from this WSDL the default configuration, usually, is that the endpoint from the WSDL is used as default. So that's how axis knows where to send the message to.

The mapping to and from XML is also generated from the WSDL. Depending on the configuration with Axis2 this will be either done using adb or jaxb. What this does it uses the annotated generated classes from the WSDL and uses that information to map from XML to Java and back again.

I don't know the dependencies axis has, but it probably uses the default Java URL connection to make the connection with the server. Since SOAP is just plain XML over HTTP there is usually no need for additional frameworks for creating this connection and invoking the endpoint.
laxmikant upadhyay
Greenhorn

Joined: Aug 24, 2012
Posts: 14
hi Dirksen,
thank you so much for your quick and useful reply ....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how does stub work ?
 
Similar Threads
A client may contain reference to the classes in the ejb-jar file?
RMI Architecture Problems
EJBObject instance doubt
Where does the LockManager class lie ? db.jar or Server.jar ?
Home object stub and EJB object stub