public class ErrorCodeAwareSoapExceptionResolver
extends org.springframework.ws.server.endpoint.AbstractEndpointExceptionResolver
EndpointExceptionResolver
implementation that stores the exception's message as the fault string.
The fault code is always set to a Server (in SOAP 1.1) or Receiver (SOAP 1.2).
Example of the generated SOAP fault response for SOAP 1.1:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring xml:lang="en">E102: the validation error</faultstring> <detail> <errorCode xmlns="http://openhubframework.org">E102</errorCode> </detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Constructor and Description |
---|
ErrorCodeAwareSoapExceptionResolver() |
Modifier and Type | Method and Description |
---|---|
protected void |
customizeFault(org.springframework.ws.context.MessageContext messageContext,
Object endpoint,
Exception ex,
org.springframework.ws.soap.SoapFault fault)
Adds error code element detail into SOAP fault.
|
Locale |
getLocale()
Returns the locale for the faultstring or reason of the SOAP Fault.
|
protected boolean |
resolveExceptionInternal(org.springframework.ws.context.MessageContext messageContext,
Object endpoint,
Exception ex) |
void |
setLocale(Locale locale)
Sets the locale for the faultstring or reason of the SOAP Fault.
|
void |
setThrottlingAsServerError(boolean throttlingAsServerError)
Sets
false if ThrottlingExceededException should be handled and SOAP fault generated
or true if ThrottlingExceededException should be treated as HTTP 500 error. |
public Locale getLocale()
Defaults to Locale.ENGLISH
.
faultstring
public void setLocale(Locale locale)
Defaults to Locale.ENGLISH
.
locale
- of faultstring
protected final boolean resolveExceptionInternal(org.springframework.ws.context.MessageContext messageContext, Object endpoint, Exception ex)
resolveExceptionInternal
in class org.springframework.ws.server.endpoint.AbstractEndpointExceptionResolver
public void setThrottlingAsServerError(boolean throttlingAsServerError)
false
if ThrottlingExceededException
should be handled and SOAP fault generated
or true
if ThrottlingExceededException
should be treated as HTTP 500 error.
Default value is false
.throttlingAsServerError
- sets behaviour for throttling exceptionprotected void customizeFault(org.springframework.ws.context.MessageContext messageContext, Object endpoint, Exception ex, org.springframework.ws.soap.SoapFault fault)
messageContext
- current message contextendpoint
- the executed endpoint, or null
if none chosen at the time of the exceptionex
- the exception that got thrown during endpoint executionfault
- the SOAP fault to be customized.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.