This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I was trying the example of Ivan’s study notes for SCDJWS (4.9 JAX-WS Web Service Clients). In this while trying dynamic Clients example I found that I have to import other classes which was not in example and also I had to import generated artifacts class, below is the import statements of my DynamicCalculatorClient:-
I used RAD7 for this example and my CalculatorService was already deployed on server and running and I generated the webservice client artifacts using WSDL and I had to import in my DynamicCalculatorClient class to suppress the compilations error. After that I was able to run the all examples using main methods:-
DynamicCalculatorClient theClient = new DynamicCalculatorClient();
Is this the correct behavior since I saw in notes that’s its written generated artifacts does not required?
Your questions is well motivated - the section which you refer to is not entirely clear which generated artifacts are not needed.
In the example, JAXB bean classes, generated using the XJC JAXB schema compiler are used in order to create request payloads and parse response payloads.
The artifacts that are not needed are the JAX-WS service class and endpoint interface.
Instead of using JAXB, the example could have used a Dispatch<Source> object to send requests. A source can be one of DOMSource, SAXSource, StAXSource, StreamSource (and JAXBSource, but that is JAXB) from which XML data representing a request is read.
That you need to add import statements in your source code is correct - there were omitted in some of the examples to conserve space.
Hope things are more clear.