You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2017/04/04 19:24:41 UTC

[jira] [Resolved] (CXF-6666) Permit "unknown" SOAP message header elements and attributes to prevent Unmarshalling Error: unexpected element

     [ https://issues.apache.org/jira/browse/CXF-6666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-6666.
------------------------------
       Resolution: Fixed
         Assignee: Daniel Kulp
    Fix Version/s: 3.2.0
                   3.1.11

> Permit "unknown" SOAP message header elements and attributes to prevent Unmarshalling Error: unexpected element
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-6666
>                 URL: https://issues.apache.org/jira/browse/CXF-6666
>             Project: CXF
>          Issue Type: Wish
>          Components: JAXB Databinding, Soap Binding
>    Affects Versions: 3.0.2
>            Reporter: Chris
>            Assignee: Daniel Kulp
>             Fix For: 3.1.11, 3.2.0
>
>
> 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|https://cxf.apache.org/javadoc/latest/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.html] 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.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)