Details
-
Wish
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.2
-
None
Description
How does one disable the strict validation on the SOAP message header that causes a "Unmarshalling Error: unexpected element" exception when unknown elements and attributes are encountered in the unmarshalling process. (In this case unknown means that elements and attributes are present in the incoming SOAP header but do not exist in the object model.)
The flow seems to be that ReadHeadersInterceptor creates a DataReader that creates an unmarshaller. The unmarshaller determines whether the custom ValidationEventHandler,
WSUIDValidationHandler, is set or not. WSUIDValidationHandler is ultimately responsible for throwing the exception.
There appears to be a couple of ways at least to disable WSUIDValidationHandler in DataReaderImpl:
1. Set the setEventHandler flag to false.
2. Ensure the veventHandler field is set to a more lenient custom ValidationEventHandler.
I cannot determine a way in which to manipulate either of these two fields in DataReaderImpl. Is there a way to do it?
The setProperty(String prop, Object value) method of DataReaderImpl looks promising because it has lots of logic related to setting the ValidationEventHandler - in particular the set-jaxb-validation-event-handler property seems perfect - but unfortunately this method is not called when unmarshalling the SOAP header part.