log.warn(errorMessage);
if (log.isDebugEnabled()) {
log.debug(errorMessage, e);
log.debug("Creating the SOAPFault to be injected...");
}
SOAPFactory factory = new SOAP11Factory();
envelope = factory.getDefaultFaultEnvelope();
SOAPFaultDetail detail = factory.createSOAPFaultDetail();
detail.setText(errorMessage);
envelope.getBody().getFault().setDetail(detail);
SOAPFaultReason reason = factory.createSOAPFaultReason();
reason.setText(errorMessage);
envelope.getBody().getFault().setReason(reason);
SOAPFaultCode code = factory.createSOAPFaultCode();
code.setText(Integer.toString(this.response.getStatusLine().getStatusCode()));
envelope.getBody().getFault().setCode(code);
}
responseMsgCtx.setServerSide(true);
responseMsgCtx.setEnvelope(envelope);
} else {
// there is no response entity-body
responseMsgCtx.setProperty(NhttpConstants.NO_ENTITY_BODY, Boolean.TRUE);
responseMsgCtx.setEnvelope(new SOAP11Factory().getDefaultEnvelope());
}
// copy the HTTP status code as a message context property with the key HTTP_SC to be
// used at the sender to set the propper status code when passing the message
int statusCode = this.response.getStatusLine().getStatusCode();