* @throws Exception if an exception occurs
*/
@Override
public void collectMetadata(ServiceHandlerFactory handlerFactory, ServiceInfo serviceInfo)
throws Exception {
GlobeServerBindingStub stub =
getCredentials()==null || getCredentials().getUsername().length()==0 || getCredentials().getPassword().length()==0?
new GlobeServerBindingStub(serviceInfo.getSoapUrl()):
new GlobeServerBindingStub(serviceInfo.getSoapUrl(), getCredentials().getUsername(), getCredentials().getPassword());
serviceInfo.getKeywords().add(serviceInfo.getType());
serviceInfo.addKeywords("liveData,service,globe",",");
// TODO: layer names and envelope
GlobeLayerInfo[] layers = stub.getLayerInfos(0);
if (layers != null) {
for (GlobeLayerInfo layer: layers) {
serviceInfo.addRDFPair("service.layername",layer.getName());
//System.err.println("layerName="+layer.getName());
//System.err.println(" layerType="+layer.getLayerType());