0

I am working upon a project and need to send a custom soap response (without SOAP fault). I’m using @Endpoint to consume SOAP requests in my spring boot application. However, I cannot use @ControllerAdvice or @ExceptionHandler to send a custom response since @Endpoint is not same as @Controller. What would be the best approach to do exception handling for mentioned situation? The exceptions can occur in any layer of the application(service , DAO etc).

Tried to use @ControllerAdvice but couldn’t get the desired result

  • 1
    For this you can create a SOAP fault response transformer using the `EndpointInterceptor ` interface. this will allow you to intercept and modify SOAP request and responses which are pass via the application. – vinoth raj Mar 17 '23 at 04:43
  • Thanks for the reply! I did try the mentioned approach. However, I am not able to set elements to the SOAP envelop. I am only able to set string attributes. As mentioned in the question, I am required to send a custom response without a soap fault element. Do you have any resource or code I can refer to? @vinothraj – Rohan Mar 19 '23 at 00:44

0 Answers0