SOAPMessage response = soapMessageFactory.createMessage();
if (responseMsg.isFault()) {
// ServiceRuntimeException e = responseMsg.getBody();
// throw e;
FaultException fe = responseMsg.getBody();
SOAPFault fault = response.getSOAPBody().addFault(new QName(response.getSOAPBody().getNamespaceURI(), "Server"), fe.getMessage());
Detail d = fault.addDetail();
DetailEntry de = d.addDetailEntry(fe.getFaultName());
SOAPElement dece = de.addChildElement("message");
if (fe.getMessage() != null) {
dece.addTextNode(fe.getMessage());
}
} else {
Element element = responseMsg.getBody();
response.getSOAPBody().addChildElement(soapFactory.createElement(element));