title: How to change fault code in soap fault using interceptor?
body: <p>Have a problem with fault code in soap fault currently in looks like this:</p>
  
  <pre><code>&lt;env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;env:Header/&gt;
     &lt;env:Body&gt;
        &lt;env:Fault xmlns:ns0="http://xmlns.telenet.be/oss/ninas/v001"&gt;
           &lt;faultcode&gt;ns0:B-NONUNIQUE-WORKORDERID&lt;/faultcode&gt;
           &lt;faultstring&gt;Work order ID is not unique&lt;/faultstring&gt;
           &lt;detail/&gt;
        &lt;/env:Fault&gt;
     &lt;/env:Body&gt;
  &lt;/env:Envelope&gt;
  </code></pre>
  
  <p>But i need it like this (without namespace prefix):</p>
  
  <pre><code>&lt;faultcode&gt;B-NONUNIQUE-WORKORDERID&lt;/faultcode&gt;
  </code></pre>
  
  <p>What I already tried:</p>
  
  <ul>
  <li>first of all i intercept soap fault with spring aop and implement EndpointInterceptor to get messageContext(org.springframework.ws.context)</li>
  <li>message context has method "setResponse" - it suites me perfectly bit the API of WebServiceMessage and its subclasses is quite poor and i can't change the insides of response in that way</li>
  <li>tried other several ways but it got even worse.</li>
  </ul>
  
  <p>Can anybody make a hint what to do to get and change fault code?
  or to avoid namespace prefix appearance in the fault code. </p>