* @throws Exception if an exception occurs
*/
@Override
public void collectMetadata(ServiceHandlerFactory handlerFactory, ServiceInfo serviceInfo)
throws Exception {
GPServerBindingStub stub =
getCredentials()==null || getCredentials().getUsername().length()==0 || getCredentials().getPassword().length()==0?
new GPServerBindingStub(serviceInfo.getSoapUrl()):
new GPServerBindingStub(serviceInfo.getSoapUrl(), getCredentials().getUsername(), getCredentials().getPassword());
serviceInfo.getKeywords().add(serviceInfo.getType());
serviceInfo.addKeywords("geographicService,service,geoprocessing",",");
//stub.getExecutionType();
GPToolInfo[] tasks = stub.getTaskInfos();
if (tasks != null) {
for (GPToolInfo tool: tasks) {
//System.err.println("task getCategory="+tool.getCategory());
//System.err.println("task getDisplayName="+tool.getDisplayName());
//System.err.println("task getName="+tool.getName());