title: soap spring ws -how to customise <faultcode>soapenv:Server</faultcode> to <faultcode>some error code.eg(a number)</faultcode>
body: <p>I am using soap spring ws to create a soap webservice and i have successfully 
  created.Now i was doing the fault implementation in this soap service and i was 
  able to do it with a class that i created like the following</p>
  
  <pre><code>public class ServiceSoapFaultMappingExceptionResolver extends SoapFaultMappingExceptionResolver
  </code></pre>
  
  <p>and inside the following overridden function,</p>
  
  <pre><code>@Override
   protected void customizeFault(Object endpoint, Exception ex, SoapFault fault) {
  //code for adding fault details
  
      Result result = fault.addFaultDetail().getResult();
  
              // marshal
              try {
                   JAXBContext.newInstance(ExceptionListType.class).createMarshaller().marshal(exceptionList, result);
  
  }
  </code></pre>
  
  <p>i created the custom soap fault object and returned that.
  This returned custom soap fault is coming inside the detail tag.
  so my fault looks like this.</p>
  
  <pre><code>&lt;soapenv:Fault&gt;
           &lt;faultcode&gt;soapenv:Server&lt;/faultcode&gt;
           &lt;faultstring&gt;INVALID NUMBER&lt;/faultstring&gt;
           &lt;detail&gt;
              &lt;ns5:exceptionListType xmlns:ns5="http://wellpoint.com/esb/header/v2"&gt;
                 &lt;ns5:errorCount&gt;1&lt;/ns5:errorCount&gt;
                 &lt;ns5:Exception&gt;
                    &lt;ns5:UUID&gt; 889c-6f73671534af&lt;/ns5:UUID&gt;
                    &lt;ns5:timestamp&gt;09/04/2015 05:47:40&lt;/ns5:timestamp&gt;
                    &lt;ns5:node&gt;mynode&lt;/ns5:node&gt;
                    &lt;ns5:process&gt;JAVA&lt;/ns5:process&gt;
                    &lt;ns5:component&gt;Unknown Component&lt;/ns5:component&gt;
                    &lt;ns5:code&gt;5009&lt;/ns5:code&gt;
                    &lt;ns5:severity&gt;FATAL&lt;/ns5:severity&gt;
                    &lt;ns5:message&gt;An unexpected server error occurred: INVALID   NUMBER&lt;/ns5:message&gt;
                 &lt;/ns5:Exception&gt;
              &lt;/ns5:exceptionListType&gt;
           &lt;/detail&gt;
        &lt;/soapenv:Fault&gt;
  </code></pre>
  
  <p>now what i want to do is i have an error code associated with the above error and it is coming inside the code tag.But i need this error code come inside this tag</p>
  
  <pre><code>&lt;faultcode&gt;soapenv:Server&lt;/faultcode&gt;
  </code></pre>
  
  <p>like </p>
  
  <pre><code>&lt;faultcode&gt;5009&lt;/faultcode&gt;
  </code></pre>
  
  <p>.I have had a lot of googling and no luck.I know it is not a good practice to have a value other than the predefined set of values available for this.But my client requierment is this.
  Please help me if anyone knows an answer.
  Thanks a lot in advance.</p>