I have a JAX-RS web service (using jersey) that accepts a JAXB object as the request entity. When we get an error, we want to log the original xml string that was sent to us. Currently, I am just re-marshalling the JAXB object, but since we have several java enums in those classes, enum values that are not spelled correctly in the original xml string are lost, which is not acceptable for our purposes.
Does anyone know a way to get the request entity as both a string and JABX object? I would prefer not to write a custom MessageBodyReader and I would prefer to not try and get the MessageBodyReader for the JAXB if possible. You are free to use jersey-specific classes as well. We are using version 1.0.x.