cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Diephouse" <...@envoisolutions.com>
Subject Re: REST attributes
Date Mon, 19 Feb 2007 18:42:15 GMT
Hi Southin,

We use JAXB to do the databinding, so you need to tell JAXB that you want a
particular property to be an attribute. If you're doing code first I think
it looks like this:

public class People {
   @XmlAttribute
   public String getId() {...}
..
}

If you're doing schema first development, simply change your schema:

<element name="People">
<complexType>
<attribute name="id" type="xsd:string"/>
</complexType>
</element>

Cheers,
- Dan


On 2/19/07, Southin Simphoukham <southin.simphoukham@gmail.com> wrote:
>
> Hi:
>
> I am new to cxf and looked at the Restful Service/Http binding example. In
> that example for People Service there was do attributes in the element
> Person.
>
> Can someone provide me with code snippet in who to best retrieve an
> attribute in that scenario.
>
> For example,
>
> <getPeople>
> <Person id="123456">....<Person>
> </getPeople>
>
> Thank you,
>
> Southin
>



-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

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