// for all non-void methods, we need to find the serializer
// for the return type, then determine if it's an array and
// deal with it accordingly
//
SerializerRegistry registry = SerializerRegistry.getInstance();
Serializer ser = registry.getSerializer(returnType);
QName returnValueName = getReturnValueName();
QName responseBodyName = getResponseName();
boolean isComplex = true;
//
// for many simple return types, we just embed the value in
// the body's response element
//
if (returnValueName == null)
{
isComplex = false;
returnValueName = responseBodyName;
}
//
// for complex types, we need a child element under the
// response body element
//
Element responseXML = XmlUtils.createElement(responseBodyName);
Element valueXML = ser.toXML(result, returnValueName);
//
// for arrays, we put the children (array items) under the
// response body element
//