Wednesday, November 12, 2014

How to disable schema validation in JAXB


Following steps helps in disabling schema validation in JAXB when SOAP response is received from SOAP web service call.

In Spring configuration file for each jaxws:client for which schema validation to be disabled, add the following element in jaxws:properties


<entry key="set-jaxb-validation-event-handler" value="false"/>

e.g

    <jaxws:client id="serviceSoa" serviceClass="com.koushik.enterprise.services.ServiceSoa"
        address="url of service" username="username" password="password">
            <jaxws:properties>
                <entry key="set-jaxb-validation-event-handler" value="false"/>
            </jaxws:properties>
    </jaxws:client>