"</soapenv:Fault>", result.toString());
}
@Test
public void testAddFaultWithDetail() throws Exception {
SoapFault fault = soapBody.addServerOrReceiverFault("faultString", Locale.ENGLISH);
SoapFaultDetail detail = fault.addFaultDetail();
SoapFaultDetailElement detailElement =
detail.addFaultDetailElement(new QName("namespace", "localPart", "prefix"));
StringSource detailContents = new StringSource("<detailContents xmlns='namespace'/>");
transformer.transform(detailContents, detailElement.getResult());
StringResult result = new StringResult();
transformer.transform(fault.getSource(), result);
assertXMLEqual("Invalid source for body",
"<soapenv:Fault xmlns:soapenv='http://www.w3.org/2003/05/soap-envelope'>" +
"<soapenv:Code><soapenv:Value>" + soapBody.getName().getPrefix() + ":Receiver</soapenv:Value>" +
"</soapenv:Code>" +
"<soapenv:Reason><soapenv:Text xml:lang='en'>faultString</soapenv:Text></soapenv:Reason>" +