use of org.springframework.ws.soap.SoapFaultDetail in project open-smart-grid-platform by OSGP.
the class DetailSoapFaultMappingExceptionResolver method customizeFault.
@Override
protected void customizeFault(final Object endpoint, final Exception ex, final SoapFault fault) {
log.error("Exception occured during SOAP request processing", ex);
final SoapFaultDetail detail = fault.addFaultDetail();
if (ex instanceof ExceptionWrapper) {
this.customizeFault(endpoint, (Exception) ex.getCause(), fault);
return;
}
if (ex.getMessage() != null) {
String messageText = ex.getMessage();
if (ex.getCause() != null) {
messageText += ": " + ex.getCause().toString();
}
detail.addFaultDetailElement(MESSAGE).addText(messageText);
}
if (ex instanceof TechnicalException) {
detail.addFaultDetailElement(COMPONENT).addText(((TechnicalException) ex).getComponentType().name());
}
}
use of org.springframework.ws.soap.SoapFaultDetail in project open-smart-grid-platform by OSGP.
the class DetailSoapFaultMappingExceptionResolver method customizeFault.
@Override
protected void customizeFault(final Object endpoint, final Exception ex, final SoapFault fault) {
final SoapFaultDetail detail = fault.addFaultDetail();
final Result result = detail.getResult();
FunctionalException fex = null;
TechnicalException tex = null;
ConnectionFailureException cex = null;
if (ex instanceof FunctionalException) {
fex = (FunctionalException) ex;
} else if (ex instanceof TechnicalException) {
tex = (TechnicalException) ex;
} else if (ex instanceof ConnectionFailureException) {
cex = (ConnectionFailureException) ex;
}
if (fex != null) {
try {
this.marshalFunctionalException(fex, result);
} catch (final JAXBException e) {
LOGGER.error("Unable to marshal the Functional Exception", e);
}
}
if (tex != null) {
try {
this.marshalTechnicalException(tex, result);
} catch (final JAXBException e) {
LOGGER.error("Unable to marshal the Technical Exception", e);
}
}
if (cex != null) {
try {
this.marshalConnectionFailureException(cex, result);
} catch (final JAXBException e) {
LOGGER.error("Unable to marshal the Connection Failure Exception", e);
}
}
}
use of org.springframework.ws.soap.SoapFaultDetail in project open-smart-grid-platform by OSGP.
the class DetailSoapFaultMappingExceptionResolver method customizeFault.
@Override
protected void customizeFault(final Object endpoint, final Exception ex, final SoapFault fault) {
final SoapFaultDetail detail = fault.addFaultDetail();
final Result result = detail.getResult();
FunctionalException fex = null;
TechnicalException tex = null;
if (ex instanceof FunctionalException) {
fex = (FunctionalException) ex;
} else if (ex instanceof TechnicalException) {
tex = (TechnicalException) ex;
}
if (fex != null) {
try {
this.marshalFunctionalException(fex, result);
} catch (final JAXBException e) {
LOGGER.error("Unable to marshal the Functional Exception", e);
}
}
if (tex != null) {
try {
this.marshalTechnicalException(tex, result);
} catch (final JAXBException e) {
LOGGER.error("Unable to marshal the Technical Exception", e);
}
}
}
Aggregations