Unexpected JAXB Element

I have a JAXB web service that does not expect to pass the identifier of the element and the client, which still passes this element.

The version of the web service that is currently running silently ignores this unexpected element, but the version in QA complains. By tracking the XML of the incoming requests, I confirmed that the Id element is sent to both the production and QA versions of the service.

Error message in QA:

org.apache.cxf.interceptor.Fault: Untying error: unexpected element (uri: " http://mydomain.com/transaction ", local: "Id"). Expected Items ...

The message is pretty clear, but the solution is not the way the client is widely deployed.

As a first step, I would like to try to understand why the production version accepts this additional element, but the QA version does not. There are not many differences between the two releases.

Suggestions, where to look?

+4
source share
1 answer

I don’t know if I received your question correctly, but I understand that you are creating xml using jaxb Marshaller and sending it to the service. in prod, your service accepts an item that you ever pass. Suppose you have a restfull webservice that cancels xml and validates the code. I suggest that instead of checking the incoming xml request, check the code deployed in QA and PROD .., since an exception will be thrown during the check that occurs after unmarshalling xml is canceled .. I hope this helps :).

0
source

Source: https://habr.com/ru/post/1308167/


All Articles