I\'m building a web service using Spring Boot (1.2.4.RELEASE) and I\'m quite new to this framework. Especially, I\'m trying to customize the SoapFault content when a
As usual, I solve my problem an hour after posting it online. I should have done it earlier !
The bean name/id I tried to override was not right. After scanning a huge amount of org.springframework.beans debug logs, I found that the right bean name is soapFaultAnnotationExceptionResolver.
I also managed to convert the configuration in Java form:
package foo.bar.ws;
// Skipping imports...
/**
* WS configuration and WSDL definition
*/
@EnableWs
@Configuration
public class WebServiceConfig extends WsConfigurerAdapter {
public final static Logger logger = Logger.getLogger( WebServiceConfig.class );
// Skipping other bean declarations...
@Bean(name = "soapFaultAnnotationExceptionResolver")
public DetailSoapFaultDefinitionExceptionResolver exceptionResolver( ApplicationContext applicationContext ){
DetailSoapFaultDefinitionExceptionResolver exceptionResolver = new DetailSoapFaultDefinitionExceptionResolver();
SoapFaultDefinition soapFaultDefinition = new SoapFaultDefinition();
soapFaultDefinition.setFaultCode( SoapFaultDefinition.SERVER );
exceptionResolver.setDefaultFault( soapFaultDefinition );
return exceptionResolver;
}
}