// 4) The type of the data block is defined by schema; thus in most cases
// an xsi:type will not be present
// Get the operation information
ParameterDescription[] pds = operationDesc.getParameterDescriptions();
MarshalServiceRuntimeDescription marshalDesc =
MethodMarshallerUtils.getMarshalDesc(endpointDesc);
TreeSet<String> packages = marshalDesc.getPackages();
// Create the message
MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
Message m = mf.create(protocol);
// Put the return object onto the message
Class returnType = operationDesc.getResultActualType();
if (returnType != void.class) {
// Use byJavaType marshalling if necessary
Class byJavaType = null;
if (MethodMarshallerUtils.isNotJAXBRootElement(returnType, marshalDesc)) {
byJavaType = returnType;
}
Element returnElement = null;
QName returnQName = new QName(operationDesc.getResultTargetNamespace(),
operationDesc.getResultName());
if (marshalDesc.getAnnotationDesc(returnType).hasXmlRootElement()) {
returnElement = new Element(returnObject, returnQName);
} else {
returnElement = new Element(returnObject, returnQName, returnType);
}
MethodMarshallerUtils.toMessage(returnElement, returnType, operationDesc.isListType(),