cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksei Valikov <aleksei.vali...@gmail.com>
Subject Re: Error unmarshalling xml
Date Sun, 18 Jul 2010 11:18:27 GMT
Hi,

> I'm trying to use the JAX-RS WebClient to deserialise some xml but I'm
> running into a problem with the namespace that is being specified by
> the web service I'm consuming.
>
> I have an entity:
>
> @XmlRootElement(name = "profile")
> @XmlType(propOrder = { "title", "firstName", "middleName" })
> public class ProfileEntity {
>
>        private String title;
>        private String firstName;
>        private String middleName;
>
> //Getters and Setters without annotations
>
> }
>
> My code to consume this looks as follows:
> WebClient client = WebClient.create(url);
> ProfileEntity profileEntity = webClient.path(serviceURL).accept(
> "application/xml").get(ProfileEntity.class);

You class does not have namespace annotations. Either add namespace
into your @Xml... annotations or @XmlSchema/@XmlNs in your
package-info.

Bye.
/lexi

Mime
View raw message