Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.4
-
None
-
None
Description
The following test case should work
String src = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
"<soapenv:Body>\n" +
"<soapenv:Fault>\n" +
" <faultcode>soap:Client</faultcode>\n" +
" <faultstring>Maximum amount exceeded passed in Mortgage Criteria Parameter name: [ValidateCriteria].[strCriteria.6]</faultstring>\n" +
" <faultactor>http://www.moneyfactswebservices.com/foxtrot/mortgage.asmx</faultactor>\n" +
" <detail/>\n" +
"</soapenv:Fault>" +
"</soapenv:Body>" +
"</soapenv:Envelope>";
MimeHeaders headers = new MimeHeaders();
headers.addHeader("Content-Type", "text/xml;");
InputStream is = new ByteArrayInputStream(src.getBytes());
SOAPMessage sm = messageFactory.createMessage(headers, is);
SOAPPart soapPart = sm.getSOAPPart();
SOAPBody soapBody = soapPart.getEnvelope().getBody();
SOAPElement elem = null;
for (Iterator it = soapBody.getChildElements(); it.hasNext() {
Object child = it.next();
if (child instanceof SOAPElement)
}
StringWriter buffer = new StringWriter();
TransformerFactory.newInstance().newTransformer().transform(new DOMSource(elem), new StreamResult(buffer));
assertEquals(elem.toString(), buffer.toString());