HI all,
I'm trying to get a JAX-WS service (with Aegis as the data binding)
working as I want but I'm falling at the last hurdle. I've got a method
defined as follows:
public Field getField(String sourceName, String fieldName) throws
FieldNotFoundException;
Field is an interface. Currently I have an implementation of FieldImpl
that returns fine via the service. The trouble is that I want to return
fields that extend FieldImpl. So for example, I have the below type
hierarchy:
Field
FieldImpl
MediaFieldImpl
TypeFieldImpl
RelatedFieldImpl
I'd like to return media, type & related fields but when I attempt to
return MediaFieldImpl via getField, I only get back the parts of
MediaFieldImpl that conform to the Field interface (so none of the extra
fields defined in MediaFieldImpl). I've been trying a variety of
different things (@XmlSeeAlso, @XmlRootElement & various different
annotations in places) to get this working but having no luck. Best
I've got so far is the MediaFieldImpl, TypeFieldImpl etc. classes
appearing in the WSDL via a dummy method as suggested in an IBM article
<http://www.ibm.com/developerworks/websphere/techjournal/0401_brown/brown.html>.
But I still can't get the correct type of Field returned from my method.
Does anyone have any suggestions on what else I can try or if I'm
barking up the wrong tree? This is using an old version of CXF (2.2)
and I'm letting CXF generate the WSDL for me. I realise I might have
more luck if I take a more top-down approach & write the WSDL myself but
as this is an existing web service I'm trying to extend, I'd rather not
rock the boat too much if I don't have to.
Cheers for any input,
Lee