<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
-------- Message original --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Sujet: </th>
<td>Re: [geotk] CSW client : unmarshalling issue</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date : </th>
<td>Tue, 10 May 2011 17:47:20 +0200</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">De : </th>
<td>Guilhem <a class="moz-txt-link-rfc2396E" href="mailto:guilhem.legal@geomatys.fr"><guilhem.legal@geomatys.fr></a></td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Pour : </th>
<td>Damiano ALBANI <a class="moz-txt-link-rfc2396E" href="mailto:damiano.albani@univ-nantes.fr"><damiano.albani@univ-nantes.fr></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>Its because of a method in the ObjectFactory which can probably be removed.
@XmlElementDecl(namespace = <a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/cat/csw/2.0.2">"http://www.opengis.net/cat/csw/2.0.2"</a>, 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,
>
</pre>
</body>
</html>