cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Theobald <>
Subject Re: JAW-WS & Returning Subclasses
Date Tue, 12 Mar 2013 09:36:07 GMT
Cheers for the input Dan.  At least I know to concentrate my efforts on 
non-Aegis routes now.  I only started with Aegis as is what we've always 
used (and have done since the days of XFire).  It certainly would be 
wise to take another look at JAXB to see how it compares nowadays.


Daniel Kulp wrote:
> Honestly, I don't think there is a way to currently do this with Aegis.   Aegis currently
doesn't have any concept of an XmlSeeAlso annotation or similar to be able to set additional
classes to add into the Aegis context.     You MAY be able to programatically create an AegisContext
object and configure in some "root" types to add additional class, but I'm not really sure
how that would all work.
> Dan
> On Mar 8, 2013, at 6:57 AM, Lee Theobald<>  wrote:
>> 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
 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message