false, // output
true, false);
String wrapperName = marshalDesc.getResponseWrapperClassName(operationDesc);
Class cls = loadClass(wrapperName, endpointDesc);
JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
Object object = null;
// Add the return object to the nameList and objectList
Class returnType = operationDesc.getResultActualType();
// Now we want to create a single JAXB element that contains the
// ParameterValues. We will use the wrapper tool to do this.
// Create the inputs to the wrapper tool
if (pdeList.size() == 0) {
if (returnType == void.class) {
// Use the short-cut for void return
object = wrapperTool.wrap(cls,
(String) null,
null,
null,
null);
} else {
// Use the short-cut for a single return
String childName = operationDesc.getResultName();
object = wrapperTool.wrap(cls,
childName,
returnObject,
returnType,
marshalDesc.getPropertyDescriptorMap(cls).get(childName));
}
} else {
// Now we want to create a single JAXB element that contains the
// ParameterValues. We will use the wrapper tool to do this.
// Create the inputs to the wrapper tool
ArrayList<String> nameList = new ArrayList<String>();
Map<String, Object> objectList = new HashMap<String, Object>();
Map<String, Class> declaredClassMap = new HashMap<String, Class>();
for (PDElement pde : pdeList) {
String name = pde.getParam().getParameterName();
// The object list contains type rendered objects
Object value = pde.getElement().getTypeValue();
Class dclClass = pde.getParam().getParameterActualType();
nameList.add(name);
objectList.put(name, value);
declaredClassMap.put(name, dclClass);
}
// Add the return type
if (returnType != void.class) {
String name = operationDesc.getResultName();
nameList.add(name);
objectList.put(name, returnObject);
declaredClassMap.put(name, returnType);
}
object = wrapperTool.wrap(cls, nameList, objectList, declaredClassMap,
marshalDesc.getPropertyDescriptorMap(cls));
}
QName wrapperQName = new QName(operationDesc.getResponseWrapperTargetNamespace(),
operationDesc.getResponseWrapperLocalName());