Hi
On 13/01/12 21:46, hdave wrote:
I'm new to REST and am trying to get my head around a good way to implement
links within my XML document to point to various state transitions (ala
HATEOAS).  I am currently using JAX-RS to annotate my service classes and
JAX-B to annotate my domain objects (resources).

Anybody here like to share how they have a working implementation of links
in XML?  Do I just implement my own link object, provide the JAXB
annotations and include in the payload?  Or should I drop XML and go with
XHTML?  Any ideas are welcome.


One option is to introduce attributes such as "href" or similar, another one is what you suggest, have an element like <customer> containing a 'link' sub-element. In both cases one needs to be prepared to modify the schema for a client to validate the payload (such that either unknown attributes/elements are ignored or such hrefs/links are recognized explicitly), or if possible, configure the client JAXB runtime to ignore unrecognized elements/attributes.

Another option is simply to use something like Atom because it lets the actual application content going unmodified, it depends on what is actually needed.

I guess XHTML is mostly targeted at browsers, though may be it can act as Atom-like XML language with links, etc, I haven't looked into how often users are actually using XHTMl in such a way or if they do it at all

Cheers, Sergey


--
View this message in context: 
http://cxf.547215.n5.nabble.com/Rest-XML-and-Links-tp5143837p5143837.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to