}
if (recurse) {
// publish each data element within the geodatabase that has metadata
GeoDataServerBindingStub stub =
getCredentials()==null || getCredentials().getUsername().length()==0 || getCredentials().getPassword().length()==0?
new GeoDataServerBindingStub(serviceInfo.getSoapUrl()):
new GeoDataServerBindingStub(serviceInfo.getSoapUrl(), getCredentials().getUsername(), getCredentials().getPassword());
DEBrowseOptions options = new DEBrowseOptions();
if (expandDescendants) {
options.setExpandType(com.esri.arcgisws.EsriDEExpandType.esriDEExpandDescendants);
} else {
options.setExpandType(com.esri.arcgisws.EsriDEExpandType.esriDEExpandChildren);
}
options.setRetrieveFullProperties(false);
options.setRetrieveMetadata(false);
// retrieve data elements
DataElement[] elements = null;
try {
if (maxDataElements < 0) {
options.setRetrieveMetadata(true);
elements = stub.getDataElements(options);
} else {
// test first without retrieving actual metadata to avoid out of memory issues,
// if under the threshould element count then go back and get the metadata
DataElement[] test = stub.getDataElements(options);
if ((test != null) && (test.length > 0) && (test.length <= maxDataElements)) {
options.setRetrieveMetadata(true);
elements = stub.getDataElements(options);
}
}
} catch (Exception e) {
LOGGER.log(Level.WARNING,"Error while processing: "+serviceInfo.getSoapUrl(),e);
return;