This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Some where I read, in this forum that usage of Collections is not recommended as JAXB will not be knowing how to bind them. So, in order to understand the problem, I started writing a sample code. The code looks as below
So as seen above, I'm trying to see how the binding works for different kinds of object types. I ran the wsgen against the above code, but would end up with the exception
The exception is misleading here, as it sounds as if an Interface can not be used as a return type here. For that matter, List is also an interface and I do not see any issue for List. It is also failing for getDatabase() for the same reason as that of Map.
Using the Interface as the return type is the quite common and also highly respected way of coding. But apparently I'm missing something here to get it work. Can someone point me out the mistake I'm making here and a corrective action.
Thanks & Regards, Ravi C.Kota
SCJP 5.0, OCDJWS 5.0