Hi ,

If the method returns an interface , jaxb can not handle it and
throws  exception .
This is the reason why it can not : http://weblogs.java.net/blog/kohsuke/archive/2006/06/jaxb_and_interf.html, FYI.

Cheers

Jim


Roberto Druetto wrote:
Hi,
 I've a problem when I try to set up a service that return a n interface.
If I make a method that returns an object of mine, I have no problem
(the client get the object with no problems), instead if I make a
method that returns an interface I get this exception on server-side:
javax.xml.bind.JAXBException: it.ipsaweb.servermonitor.interfaces.Test

Here the methods:

MyObject getMyObject(); // ok, no problem
MyInterface getMyInterface(); // throws that exception

MyObject getMyObject(){
 return new MyObject();
}

MyInterface getMyInterface(){
  MyInterface m = new MyObject();
  return m;
}

what is the problem in your opinion?

Thanks.
Roberto

Reply via email to