I'm developing a Spring 3 MVC app and I need to handle HTTP POST requests with XML in the following format:
There can be ~100 fields, all named Field_nnn. The actual fields included in a request will vary depending on the message type.
<?xml version="1.0" encoding="UTF-8"?>
I've previously used XStream with @RequestBody/@ResponseBody for more consistently-structured XML requests, but I'd rather not map this XML structure onto a class with so many fields. Ideally I'd like to map it to an object with a list of general fields, and implement setField(index, value)/GetField(index) methods, having it serialize/deserialize depending on which fields are present.
Are there any Spring-friendly mapping frameworks that can accommodate this? Am I better off handling SAX events myself for this? All suggestions/thoughts welcome!