This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one 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