private static void processCallQuery(CommonParams cparams, XmlSchemaElement parentElement,
CallQuery callQuery) throws DataServiceFault {
if (!callQuery.getQuery().hasResult()) {
return;
}
Result result = callQuery.getQuery().getResult();
XmlSchemaElement activeElement = parentElement;
XmlSchemaElement tmpElement;
/* process result wrapper */
if (!DBUtils.isEmptyString(result.getElementName())) {
tmpElement = getElement(cparams, result.getNamespace(), result.getElementName());
if (tmpElement != null) {
/* the element already exists .. */
addToElement(cparams, activeElement, tmpElement, true);
/* no need to continue */
return;
}
activeElement = createAndAddToElement(cparams, activeElement,
result.getElementName(), result.getNamespace(), true);
}
/* process result row */
if (!DBUtils.isEmptyString(result.getRowName())) {
tmpElement = getElement(cparams, result.getNamespace(), result.getRowName());
if (tmpElement != null) {
addToElement(cparams, activeElement, tmpElement, true);
return;
}
activeElement = createAndAddToElement(cparams, activeElement,
result.getRowName(), result.getNamespace(), false);
/* rows can be from zero to infinity */
activeElement.setMinOccurs(0);
activeElement.setMaxOccurs(Long.MAX_VALUE);
}
/* process the result content */
processElementGroup(cparams, activeElement, result.getDefaultElementGroup());
}