* error setting the fault string.
*/
static void setFault(SOAPMessage message, int errorCode,
String errorMessage)
throws SOAPException {
SOAPEnvelope se = message.getSOAPPart().getEnvelope();
// Work around for Bug 6581434 in JDK 1.6:
// javax.xml.soap.Detail.addDetailEntry is broken
/*
SOAPFault fault = se.getBody().addFault();
fault.setFaultString(errorMessage);
Detail detail = fault.addDetail();
detail.addNamespaceDeclaration(Consts.ASAP_PREFIX, Consts.ASAP_NS);
Name codeName
= se.createName("ErrorCode", Consts.ASAP_PREFIX, null);
DetailEntry codeDetail = detail.addDetailEntry(codeName);
codeDetail.addTextNode(Integer.toString(errorCode));
Name messageName
= se.createName("ErrorMessage", Consts.ASAP_PREFIX, null);
DetailEntry messageDetail = detail.addDetailEntry(messageName);
messageDetail.addTextNode(errorMessage);
*/
final String SOAP_ENV = "http://schemas.xmlsoap.org/soap/envelope/";
SOAPBody sb = se.getBody();
SOAPBodyElement fault
= sb.addBodyElement(se.createName("Fault", "SOAP_ENV", SOAP_ENV));
fault.addChildElement("faultstring")
.addTextNode(errorMessage);
SOAPElement detail = fault.addChildElement("detail");
detail.addChildElement
("ErrorCode", Consts.ASAP_PREFIX, Consts.ASAP_NS)