}
QName faultType = fault.getMessage().getQName();
QName faultName = new QName(wsdlDefinition.getTargetNamespace(),
fault.getName());
Message response = odeMex.createMessage(faultType);
response.setMessage(odeMsgEl);
odeMex.replyWithFault(faultName, response);
} else {
SOAPFault soapFault = reply.getEnvelope().getBody().getFault();
QName faultType = new QName(wsdlDefinition.getTargetNamespace(),
"UnknownFault");
Message response = odeMex.createMessage(faultType);
Element actAsPart = odeMsgEl.getOwnerDocument().createElementNS(null,
soapFault.getLocalName());
odeMsgEl.appendChild(actAsPart);
if (soapFault.getCode() != null) {
actAsPart.appendChild(odeMsgEl.getOwnerDocument().importNode(
OMUtils.toDOM(soapFault.getCode()), true));
}
if (soapFault.getReason() != null) {
actAsPart.appendChild(odeMsgEl.getOwnerDocument().importNode(
OMUtils.toDOM(soapFault.getReason()), true));
}
if (log.isWarnEnabled()) {
log.warn("Fault response: " + DOMUtils.domToString(odeMsgEl));
}
response.setMessage(odeMsgEl);
odeMex.replyWithFault(faultType, response);
}
} else {
Message response =
SOAPUtils.parseSOAPResponseFromPartner(partnerInvocationContext, odeMex);
if (log.isDebugEnabled()) {
log.debug("Response:\n" + (response.getMessage() != null ?
DOMUtils.domToString(response.getMessage()) : "empty"));
}
odeMex.reply(response);
}
} catch (Exception ex) {
String errmsg = "Unable to process response: " + ex.getMessage();