// If not true that all the wsdl:partS are bound,
// the assertion failed
if (!inputParts
.containsAll(portTypeInput.getMessage().getParts().keySet()))
{
throw new AssertionFailException("The wsdl:input of the \""
+ bindingOperation.getName() + "\" binding operation does not "
+ "bind all the corresponding wsdl:partS.");
}
}
// If the corresponding wsdl:output exists in wsdl:portType
// and includes the message attribute
if (portTypeOutput != null && portTypeOutput.getMessage() != null)
{
// Getting the list of all the parts bound by wsdl:output's child elements
List outputParts = getBindingParts(
bindingOperation.getBindingOutput().getExtensibilityElements(),
portTypeOutput.getMessage());
// If not true that all the wsdl:partS are bound,
// the assertion failed
if (!outputParts
.containsAll(portTypeOutput.getMessage().getParts().keySet()))
{
throw new AssertionFailException("The wsdl:output of the \""
+ bindingOperation.getName() + "\" binding operation does not "
+ "bind all the corresponding wsdl:partS.");
}
}
// IF there are wsdl:faultS in the wsdl:portType operation
if (!bindingOperation.getOperation().getFaults().isEmpty())
{
// Collecting all the soap:fault names
List faultNames = new ArrayList();
Collection faults = bindingOperation.getBindingFaults().values();
// Going through all the wsdl:faultS
Iterator it = faults.iterator();
while (it.hasNext())
{
// Getting wsdl:fault's extensibility elements
List extElems = ((BindingFault) it.next()).getExtensibilityElements();
for (int j = 0; j < extElems.size(); j++)
{
if (((ExtensibilityElement)extElems.get(j))
.getElementType().equals(WSDL_SOAP_FAULT))
{
faultNames.add(((SOAPFault)extElems.get(j)).getName());
}
}
}
// Going through all the soap:headerfaultS
faultNames.addAll(findAllHeaderFaults(bindingOperation));
// If not true that all the wsdl:faultS are bound,
// the assertion failed
if (!faultNames.containsAll(
bindingOperation.getOperation().getFaults().keySet()))
{
throw new AssertionFailException("The binding operation \""
+ bindingOperation.getName() + "\" does not "
+ "bind all the corresponding wsdl:faultS.");
}
}
}