Reader reader = new StringReader(xmlString);
InputSource src = new InputSource(reader);
SOAPBodyElement bodyItem = getFirstBody(src);
assertTrue("The SOAPBodyElement I got was not a SOAPFault, it was a " +
bodyItem.getClass().getName(), bodyItem instanceof SOAPFault);
SOAPFault flt = (SOAPFault)bodyItem;
flt.addDetail();
javax.xml.soap.Detail d = flt.getDetail();
Iterator i = d.getDetailEntries();
while (i.hasNext())
{
DetailEntry entry = (DetailEntry) i.next();
String name = entry.getElementName().getLocalName();
if ("tickerSymbol".equals(name)) {
assertEquals("the value of the tickerSymbol element didn't match",
"MACR", entry.getValue());
} else if ("exceptionName".equals(name)) {
assertEquals("the value of the exceptionName element didn't match",
"test.wsdl.faults.InvalidTickerFaultMessage", entry.getValue());
} else {
assertTrue("Expecting details element name of 'tickerSymbol' or 'expceptionName' - I found :" + name, false);
}
}
assertTrue(d != null);