if (WSIConstants
.ATTRVAL_SOAP_BIND_STYLE_RPC
.equals(match.getOperationStyle()))
responseSig.createRPCSignature();
WSDLTraversal traversal = new WSDLTraversal();
//VisitorAdaptor.adapt(this);
traversal.setVisitor(this);
traversal.visitSOAPFault(true);
traversal.ignoreBindingInput();
traversal.ignoreBindingOutput();
if (responseSig == null || !responseSig.isFault())
{
result = AssertionResult.RESULT_NOT_APPLICABLE;
}
else if (responseSig != null && responseSig.isFault())
{
// extract all faults and try find them in the definition
// extracts only faults with namespace
Element body =
XMLUtils.findChildElement(
docResponse.getDocumentElement(),
WSITag.ELEM_SOAP_BODY);
Element fault =
XMLUtils.findChildElement(body, WSITag.ELEM_SOAP_FAULT);
Element detail = XMLUtils.getElement("detail", fault);
if (detail == null)
{
result = AssertionResult.RESULT_NOT_APPLICABLE;
}
else
{
result = AssertionResult.RESULT_PASSED;
faults = XMLUtils.getChildElements(detail);
// REMOVE: Why do the faults have to be namespaced qualified?
//XMLUtils.removeAllElementsWithoutNS(faults);
// if faults exist try to validate it
if (faults.size() > 0)
{
Map m = new HashMap();
WSDLUtil.expandDefinition(
validator.analyzerContext
.getCandidateInfo()
.getWsdlDocument()
.getDefinitions());
m.put(
"definition",
validator.analyzerContext
.getCandidateInfo()
.getWsdlDocument()
.getDefinitions());
TypesRegistry tReg =
new TypesRegistry(
validator.analyzerContext
.getCandidateInfo()
.getWsdlDocument()
.getDefinitions(),
validator);
m.put("TypesRegistry", tReg);
traversal.traverse(match.getOperation(), m);
if (faults.size() > 0)
{
result = AssertionResult.RESULT_WARNING;
StringWriter sw = new StringWriter();
for (int i = 0; i < faults.size(); i++)