This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi, I am new to web services. Can someone explain me please what does the WebService and WebServiceClient annotations really do behind the scenes ? Does the container adds some AOP code (or something like that) whenever an instance of the annotated class is created ?
Thanks for any reply :-)
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
posted
0
It's nothing that fancy.
There isn't a container - however the service provider requires an HTTP server (Java SE 6 comes with com.sun.net.httpserver.HttpServer). And it isn't AOP.
The annotations basically provide binding hints for code generators like wsgen (for a Java SE 6 web service) and wsimport (for a Java SE 6 web service client).
Thank you for replying :-) Now it is more clear form me... wsgen uses the @WebService annotation for creating all the required classes for web service deployment, and invocation. But there is still something I don't understand... why wsimport (that reads the wsdl and generates the required classes) adds annotations to the code ? who is going to use them ?
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
posted
0
Originally posted by Esteban Puertas: why wsimport (that reads the wsdl and generates the required classes) adds annotations to the code ? who is going to use them ?
It is there to differentiate the generated code from the developer code. It documents the relationship between the WSDL and the generated code in such a way that an IDE can use them to navigate between the code and the WSDL and correlate between the WSDL fragments and the code artifacts.