List parts = wsdlMessage.getOrderedParts(null);
if (parts.size() != wsDriverMessage.size()) {
// Both sets of parts should be the same size.
throw new WSIFException("Wrong number of parts. " +
"WSDL message " + wsdlMessage.getQName() +
" has " + parts.size() + " parts. The wsdriver.Message" +
" equivalent has " + wsDriverMessage.size());
}
for (int i = 0; i < parts.size(); i++) {
javax.wsdl.Part wsdlPart = (javax.wsdl.Part)parts.get(i);
Part wsDriverPart = wsDriverMessage.retrievePart(i);
if (!wsDriverPart.getName().equals(wsdlPart.getName())) {
// Both sets of parts should be in the same order and have the
// same set of part names.
throw new WSIFException("Unexpected part name. Expected \"" +
wsdlPart.getName() + "\" but was \"" +
wsDriverPart.getName() + "\".");
}
wsifMessage.setObjectPart(wsDriverPart.getName(),