if (outputMessage == null) {
throw new OpenEJBException("No output message, but a mapping for it for operation " + operationName);
}
// verify mapped return value qname matches expected output message name
final WsdlReturnValueMapping wsdlReturnValueMapping = methodMapping.getWsdlReturnValueMapping();
if (!wsdlReturnValueMapping.getWsdlMessage().equals(outputMessage.getQName())) {
throw new OpenEJBException("OutputMessage has QName: " + outputMessage.getQName() + " but mapping specifies: " + wsdlReturnValueMapping.getWsdlMessage() + " for operation " + operationName);
}
//
// Determind return type qname and xml schema type
//
QName returnQName = null;
QName returnXmlType = null;
if (wsdlReturnValueMapping.getWsdlMessagePartName() != null) {
final String wsdlMessagePartName = wsdlReturnValueMapping.getWsdlMessagePartName();
if (outParamNames.contains(wsdlMessagePartName)) {
throw new OpenEJBException("output message part " + wsdlMessagePartName + " has both an INOUT or OUT mapping and a return value mapping for operation " + operationName);
}
if (bindingStyle.isWrapped()) {
final Part outPart = getWrappedPart(outputMessage);
final XmlElementInfo returnParticle = getWrapperChild(outPart, wsdlMessagePartName);
returnQName = new QName("", returnParticle.qname.getLocalPart());
returnXmlType = returnParticle.xmlType;
} else if (bindingStyle.isRpc()) {
final Part part = outputMessage.getPart(wsdlMessagePartName);
if (part == null) {
throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
}
returnQName = new QName("", part.getName());
// RPC can only use type
returnXmlType = part.getTypeName();
} else {
final Part part = outputMessage.getPart(wsdlMessagePartName);
if (part == null) {
throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
}
returnQName = getPartName(part);
returnXmlType = returnQName;
}
outParamNames.add(wsdlMessagePartName);
} else {
// what does this mean????
}
operationInfo.returnQName = returnQName;
operationInfo.returnXmlType = returnXmlType;
operationInfo.returnJavaType = wsdlReturnValueMapping.getMethodReturnValue();
}