JAXB Unexpected Element
I have a JAXB web service that does not expect the element Id to be passed across, and a client that passes that element anyhow.
The version of the web se开发者_开发技巧rvice currently in production silently ignores that unexpected element, but the version in QA complains. Tracing the XML of inbound requests, I confirmed the Id element is sent both to the production and QA versions of the service.
The error message in QA is:
org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"http://mydomain.com/transaction", local:"Id"). Expected elements are...
The message is pretty clear, but the solution is not as the client is widely deployed.
As a first step, I would like to try and understand why the production version accepts this extra element while the QA version does not. There are not many differences between the two releases.
Suggestions where to look?
i dont know whether i got you question correct, but what i understand that you are creating xml using jaxb Marshaller and sending it to service. in prod your service accepts element which ever you pass..i assume that you have restfull webservice which unmarshalls the xml and validation by code. i suggest instead of inspecting inbound xml request check the code deployed in QA and PROD.. since the exception will be thrown during the validation which happens after unmarshalling of xml.. hope this helps :).
精彩评论