I have a https-listener with max-post-size set in standalone.xml of JBoss (Wildfly):
<https-listener name="https" socket-binding="https" max-post-size="50000000" security-realm="ApplicationRealm" verify-client="REQUESTED" enable-http2="true" />
I have a JSON @RestController, where I can use a @ControllerAdvice with:
@ExceptionHandler(MaxUploadSizeExceededException.class)
It handles the event of uploading a too large file nicely.
However I also have a SOAP-XML @Endpoint:
@PayloadRoot(namespace = "http://service.upload.com/", localPart = "upload")
@ResponsePayload
public JAXBElement<UploadResponse> upload(@RequestPayload Upload upload) throws UploadException {
return service.process(upload);
}
This reponds with an ugly HTML.
I would like to know how to "advice" the SOAP interface to handle exceptions of too large requests.