views:

80

answers:

0

I am developing a web service contract first, and I wish to use XML object graphs (ID, IDREF) to eliminate redundant data.

So, I have a situation where I have a complexType which has an xsd:ID attribute, and another one referring to it through xsd:IDREF. I also included the jaxb:baseType with the name of the complexType so that the class name matches in the code.

The wsdl2Java (metro and CXF) are generating fine, however I noticed that the @XmlIDREF annotation is not being generated to the IDREF field. I also noticed when I am testing the service using SoapUI, that the data is after all being copied again within the IDREF element, which I suspect is happening because JAXB won't know that he needs to link to a previously included instance.

How do I get the @XmlIDREF in there (through the contract not manually, this is contract first and needs to allow clients to generate stubs correctly)? Am I doing things in the right way to eliminate redundant XML objects from being repeated?