Activating JAXB Validation of SOAP requests and responses
For the client side
<jaxws:client name="{http://apache.org/hello_world_soap_http}SoapPort"
createdFromAPI="true">
<jaxws:properties>
<entry key="schema-validation-enabled" value="true" />
</jaxws:properties>
</jaxws:client>
You may also do this programmatically:
((BindingProvider)port).getRequestContext().put(
"schema-validation-enabled", "true");
For the server side
<jaxws:endpoint name="{http://apache.org/hello_world_soap_http}SoapPort"
wsdlLocation="wsdl/hello_world.wsdl" createdFromAPI="true">
<jaxws:properties>
<entry key="schema-validation-enabled" value="true" />
</jaxws:properties>
</jaxws:endpoint>
You can also use the org.apache.cxf.annotations.SchemaValidation annotation.