Thanks for posting the suggestion to use the XSLT script.
I have tried it and I have found that var://service/error-message does not actually contain the XSD validation error.
For instance, in my test, the log shows the following error:
xmlfirewall (XXXX): Schema Validation Error
xmlfirewall (XXXX): Execution of 'local:///XXXX.xsd' aborted:
http://dynamic:80/XXXXX: cvc-particle 2.1: in element {http://www.XXXX}Foo with anonymous type, found <wms:FooBar> (in namespace
http://www.XXXX), but next item should be {http://www.XXXX}Bar
But when I go in the probe and I check the context information right after the validation, the var://service/error-message contains
'<?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="
http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Client</faultcode><faultstring>Internal Error (from client)</faultstring></env:Fault></env:Body></env:Envelope>'
I think that in order to capture the error, we may need to use the schema-validate extension function. The documentation does not make it clear that it should return the error, but it's worth a try... The documentation says that the function returns the validated node-set but it's possible that in case of failure it would return the error... I haven't tried that though.