You'll have a much easier time understanding the "basics" if you simply use Java SE 6.
To build:
To run:
Now with the web browser check
http://localhost:8080/wsdemo/stock_quote?wsdl and
http://localhost:8080/wsdemo/stock_quote?xsd=1 Control-C exits the com.sun.net.httpserver.HttpServer
wsgen creates:
com/wakaleo/tutorials/webservices/server/jaxws/GetQuote.class JVM server object version of {http://server.webservices.tutorials.wakaleo.com}getQuote
com/wakaleo/tutorials/webservices/server/jaxws/GetQuoteResponse.class JVM server object version of {http://server.webservices.tutorials.wakaleo.com}getQuoteResponse
The client code
To build (while com.wakaleo.tutorials.webservices.server.Main is running in another console window to present the WSDL):
To run (while com.wakaleo.tutorials.webservices.server.Main is running in another console window):
Output:
wsimport creates:
com/wakaleo/tutorials/webservices/client/GetQuote.class JVM client object version of {http://server.webservices.tutorials.wakaleo.com}getQuote
com/wakaleo/tutorials/webservices/client/GetQuoteResponse.class JVM client object version of {http://server.webservices.tutorials.wakaleo.com}getQuoteResponse
com/wakaleo/tutorials/webservices/client/ObjectFactory.class most likely the code responsible for Object/XML marshalling unmarshalling
com/wakaleo/tutorials/webservices/client/package-info.class metadata?
com/wakaleo/tutorials/webservices/client/StockQuote.class Class implementing the service port
com/wakaleo/tutorials/webservices/client/StockQuoteService.class Class implementing the service
This is an example of "Contract Last Development" - i.e. the Java server code is written first and the service contract (WSDL) is generated from that.
I personally prefer
Contract First Development - i.e. design the artifact that the client actually sees (the WSDL) first and then use the contract to generate some server stubs.
[ February 21, 2008: Message edited by: Peer Reynders ]