I am using spring rest template to interact with a rest service written using wcf (consuming xml).
I have an entity class called Rule having common fields and a child class CustomRule with some specific fields.
WCF service is expecting xml elements in alphabetical order, I tried using @XmlAccessorOrder on my base and child class but generated xml has base class fields in sorted order and child class fields in sorted order, but all elements in xml are not sorted
i.e. If Rule has fields S,A,B
CustomRule has Z,C
I expect A,B,C,S,Z order in xml,
instead I get A,B,S,C,Z.
Can someone please help?
Also is it possible to order xml elements based on value in XmlElement type instead varibale name in class ?