title: Spring WS: How to get and save XSD validation errors
body: <p>I use SpringWS for my soap service and validate it like this;</p>
  
  <pre><code> &lt;sws:interceptors&gt;
      &lt;bean id="payloadValidatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"&gt;
          &lt;property name="schema" value="/schemas/my.xsd"/&gt;
          &lt;property name="validateRequest" value="false"/&gt;
          &lt;property name="validateResponse" value="true"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>@PayloadRoot(namespace = NAMESPACE,  localPart = "ServiceProvider")
  @ResponsePayload
  public ServiceProviderTxn getAccountDetails(@RequestPayload ServiceProviderrequest)
  { ...}
  </code></pre>
  
  <p>This works fine but when there is an error it returns a spring generated error response before it reaches to the endpoint, so I never have a chance to process them. But I want to be able to <strong>log and save the full error message to database</strong>. One way I found out is to do something like this in my other question;</p>
  
  <p><a href="https://stackoverflow.com/questions/30671052/spring-ws-how-to-get-all-error-messages-when-validation-fails">Spring WS How to get all error messages when validation fails</a></p>
  
  <p>But it does not work as I want.</p>