List of usage examples for javax.xml.soap Detail getOwnerDocument
public Document getOwnerDocument();
Document
object associated with this node. From source file:edu.duke.cabig.c3pr.webservice.studyimportexport.impl.StudyImportExportImpl.java
/** * Creates the soap fault.// w w w. j ava2 s .c o m * * @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); } }