// The engine should have checked to make sure that the messages that are delivered conform
// to the correct format; but you know what they say, don't trust anyone.
if (!(onMessage.variable.type instanceof OMessageVarType)) {
String errmsg = "Non-message variable for receive: should have been picked up by static analysis.";
__log.fatal(errmsg);
throw new InvalidProcessException(errmsg);
}
OMessageVarType vartype = (OMessageVarType) onMessage.variable.type;
// Check that each part contains what we expect.
for (String pName : partNames) {
QName partName = new QName(null, pName);
Element msgPart = DOMUtils.findChildByName(msgEl, partName);
OMessageVarType.Part part = vartype.parts.get(pName);
if (part == null) {
String errmsg = "Inconsistent WSDL, part " + pName + " not found in message type " + vartype.messageType;
__log.fatal(errmsg);
throw new InvalidProcessException(errmsg);
}
if (msgPart == null) {
String errmsg = "Message missing part: " + pName;
__log.fatal(errmsg);
throw new InvalidContextException(errmsg);