title: Server-Side XML Validation with CXF Webservice
body: <p>I'm working on an Apache CXF webservice (using JAX-WS, over SOAP).  The service itself is pretty simple: receive a request, insert the request into a database, and return whether the insert was successful.  I'd like to rely on XML validation to enforce a number of constraints on the request.</p>
  
  <p>So, my question.  How do I return detailed validation errors to a client of my service?  I've turned validation on server-side by configuring my endpoint.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;jaxws:endpoint id="someEndpoint" implementor="#someImpl" address="/impl"&gt;
      &lt;jaxws:properties&gt;
          &lt;!-- This entry should- ideally- enable JAXB validation
          on the server-side of our web service. --&gt;
          &lt;entry key="schema-validation-enabled" value="true" /&gt;
      &lt;/jaxws:properties&gt;
  &lt;/jaxws:endpoint&gt;
  </code></pre>
  
  <p>I've explored using interceptors (eg BareInInterceptor) on the server, and somehow catching SAXParseExceptions to wrap them and send them along to the client.  This approach seems a bit complicated, but I need to somehow give clients a line number if their XML is invalid.  Should I go with interceptors to expose the exceptions?</p>
  
  <p>I'm not very experienced with this technology stack, and just getting in to web services- any pointers you guys can give me would be really appreciated.</p>