Hi!
First, to you and others who are asking questions about my study notes, please refer to the section or page on which the example is - this makes it easier for me to find it. Thanks in advance!
Jolly Tiwari wrote:1. What i understood from the topic in the notes is that we must have JAXB generated classes with us before we execute this kind of client and we have to pass the package name of the generated classes to the JAXBContext("abc.def").Am i correct?
No, the client does not depend on using JAXB to create a request message. JAXB is just a convenient way to do it. You can also create
SOAP messages using SAAJ, as can be seen on pages 203 and 204 in my study notes.
I think we can generate them with wsimport pretty easily.
Yes, JAXB bean classes can be generated with either wsimport or with the XJC JAXB schema compiler.
2.Do we have some programming api , using which we can generate these JAXB classes.
Not that I currently know of. You can, as I have shown in my study notes, use
Ant scripts to run wsimport or XJC.
3.When we can go for service operation invocation via PROXY mechanism which is far easier from programmer's perspective, why will some one go for this approach for Synchronous call.Can you please elaborate with some scenario so that we could understand it.
If you do not have access to the WSDL of a service when writing your program.
Two possible cases:
Lets say you want to write a web service
testing program, like soapUI. Then you cannot use the proxy mechanism because you do not know which web services you will need to send requests to, at the time of writing your program.
If you are writing a client of a web service that only sends XML messages, without using SOAP, then you cannot generate any proxies because there probably is no WSDL.
Best wishes!