[geotk] CSW client : unmarshalling issue
Guilhem
guilhem.legal at geomatys.fr
Tue May 10 11:48:05 EDT 2011
-------- Message original --------
Sujet: Re: [geotk] CSW client : unmarshalling issue
Date : Tue, 10 May 2011 17:47:20 +0200
De : Guilhem <guilhem.legal at geomatys.fr>
Pour : Damiano ALBANI <damiano.albani at univ-nantes.fr>
Its because of a method in the ObjectFactory which can probably be removed.
@XmlElementDecl(namespace = "http://www.opengis.net/cat/csw/2.0.2", name
= "GetRecordByIdResponse")
public JAXBElement<GetRecordByIdResponseType>
createGetRecordByIdResponse(final GetRecordByIdResponseType value) {
return new
JAXBElement<GetRecordByIdResponseType>(_GetRecordByIdResponse_QNAME,
GetRecordByIdResponseType.class, null, value);
}
It can be used when the annotated class does not have a @XmlRootElement
annotation (in our case we have write the annotation, that why we may
remove the method in the factory).
However when you work with JAXB in general, you'll have often to deal
with JAXBElement, so i suggest you to always have this test after
unmarshall.
Guilhem Legal.
Le 10/05/2011 17:34, Damiano ALBANI a écrit :
> On 05/10/2011 05:24 PM, Guilhem wrote:
>> response = ((JAXBElement)response).getValue();
>
> Indeed, works fine now, thanks!
> But, what the reason why this additional JAXB-thing step is necessary?
>
> Regards,
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geotoolkit/attachments/20110510/00c224a3/attachment.html
More information about the Geotoolkit
mailing list