<faultcode>SOAP-ENV:Server</faultcode> is always the same value in SOAP and Spring WS
17:21 28 Jun 2017

I am to try catching the exception from a SOAP web service in Spring WS (java) with the follows code:

String faultString = "String Y";
            String faultCodeValue = "Code X";
            QName faultCode = new QName("http://schemas.xmlsoap.org/soap/envelope/", faultCodeValue);
            SOAPFault soapFault = null;
            soapFault = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL).createFault(faultString, faultCode);
            throw new SOAPFaultException(soapFault);

However I always getting the same like this (SOAP-ENV:Server)

(even when I changed the value in faultCodeValue variable):


   
   
      
         SOAP-ENV:Server
         String Y
      
   

Does Someone knows how to change this value in the web service response?

java spring web-services soap