List of usage examples for javax.xml.soap Detail appendChild
public Node appendChild(Node newChild) throws DOMException;
newChild
to the end of the list of children of this node. From source file:edu.duke.cabig.c3pr.webservice.studyimportexport.impl.StudyImportExportImpl.java
/** * Creates the soap fault.//from www. j a va 2 s .c om * * @param msg the msg * @return the sOAP fault */ private SOAPFault createSOAPFault(String msg) { try { SOAPFactory factory = SOAPFactory.newInstance(); SOAPFault fault = factory.createFault(); fault.setFaultString(msg); fault.setFaultCode(new QName(SOAP_NS, SOAP_FAULT_CODE)); Detail detail = fault.addDetail(); final Element detailEntry = detail.getOwnerDocument().createElementNS(SERVICE_NS, STUDY_IMPORT_FAULT); detail.appendChild(detailEntry); final Element detailMsg = detail.getOwnerDocument().createElementNS(SERVICE_NS, FAULT_MESSAGE); detailMsg.setTextContent(msg); detailEntry.appendChild(detailMsg); return fault; } catch (SOAPException e) { log.error(ExceptionUtils.getFullStackTrace(e)); throw new WebServiceException(e); } }