Just like validating an XML file against an XML Schema Definition in Java is there a way to validate an XML file that contains a SOAP Envelope against a WSDL file?
Some web service containers provide this functionality. JBoss 3.0.1+ does this with the @SchemaValidation annotation:
http://community.jboss.org/wiki/JBossWS-NativeUserGuide#SchemaValidation
If you are using Spring-WS, this can be done by using an interceptor along these lines:
<sws:interceptors>
<sws:payloadRoot namespaceUri="...">
<bean id="validatingInterceptor"
class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
<property name="schema" value="classpath:/wsdl/schema.xsd" />
<property name="validateRequest" value="true" />
<property name="validateResponse" value="true" />
</bean>
</sws:payloadRoot>
</sws:interceptors>
With CXF, here is an approach:
http://cxf.apache.org/faq.html#FAQ-HowcanIturnonschemavalidationforjaxwsendpoint%3F
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With