-
1. Re: WebRemote method serialization with interfaces
shane.bryzak May 18, 2006 11:04 PM (in response to knaas)I'll have a look at this over the next few days, it shouldn't be difficult to traverse the inheritence chain and include inherited fields.
-
2. Re: WebRemote method serialization with interfaces
knaas May 19, 2006 9:07 AM (in response to knaas)Here's another interesting related problem, when the server serializes the return object, it serializes the class. Because the WebRemote method returns an interface, the javascript client does not know that that class actually implements that interface.
Hypothetical Example:@Name("service") public class Service { @WebRemote public InterfaceA getA() { return new ClassA(); } } public interface InterfaceA { public String getText(); } class ClassA implements InterfaceA { public String getText() { return "HelloWorld"; } }
I'm not sure how one would get this to work correctly.
Is there a way to force remote interface generation for ClassA?
Could the BeanWrapper also output the names of the interfaces in the block?
For instance,<bean type="ClassA" interfaces="InterfaceA">....</bean>
-
3. Re: WebRemote method serialization with interfaces
shane.bryzak May 19, 2006 10:20 AM (in response to knaas)Hmm... I can see how this could be a problem. ClassA would not be defined by the client stub so the client would not know how to deal with it when it is returned. Your idea of including a list of interfaces inside the serialized block sounds good. I'll think about it for a couple of days (its the last day of JavaOne so I won't have time today)