-
1. Re: Is polymorphic JAX-WS operation parameter possible to implement?
gmlopezdev May 16, 2013 7:15 PM (in response to gmlopezdev)Isn't there anyone out ther who has an idea why is this not working and/or if there is any workaround?
I cannot even get a simple Object to work with a subtype. The generated wsdl doesn't even defines the hierarchy. I did modify the wsdl by myself but had no luck. The object is allways getting unmarshalled as the supertype and I get and unmarshalling error if a subtype's property is sent to the server.
Thanks again for your help!
-
2. Re: Is polymorphic JAX-WS operation parameter possible to implement?
gmlopezdev May 17, 2013 4:06 PM (in response to gmlopezdev)I finally got this resolved. It is absolutely possible to implement this behavior. If I were developing a single EAR I wouldn´t have experienced a problem like this.
Since I'm developing several enterprise applications (EAR modules) over JBoss AS 7 which need to communicate through their local interfaces, I need to publish them as modules (including DTOs). Even I was getting no other symptom of errors or problems but the one I described, the issue was caused because my module must declare the dependency over jaxb api. Otherwise the annotations have no effect. Once I added this dependency to the module, everything started to work normally as expected :-).
Important things to remember here:
Declare your sub classes as the following within your parent class:
@XmlSeeAlso({Pojo1.class, Pojo2.class, ...})
If your classes are published as a JBoss module, do not forget to declare the jaxb dependency.
I hope this may help others like me in the future :-).