Changeset 3961


Ignore:
Timestamp:
Nov 13, 2007, 8:25:51 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #822.

Location:
trunk/src/examples/webservices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/examples/webservices/README

    r3958 r3961  
    2727
    2828From the command line type:
     29
    2930ant compile    To compile the test code
    3031ant test       To test the connection to the BASE server
     32
     33You may also override the connection options on the command line. Use one or
     34several -D options when starting Ant (on one line):
     35
     36ant -Dservices.url=http://localhost/base/services
     37 -Dservices.login=mylogin -Dservices.password=mypassword
     38
    3139
    3240
  • trunk/src/examples/webservices/src/net/sf/basedb/ws/example/Main.java

    r3958 r3961  
    2929import net.sf.basedb.info.ProjectInfo;
    3030import net.sf.basedb.info.QueryOptions;
     31import net.sf.basedb.info.VersionInfo;
    3132import net.sf.basedb.ws.client.ExperimentClient;
    3233import net.sf.basedb.ws.client.ProjectClient;
     
    109110    this.serviceUrl = serviceUrl;
    110111    this.session = new SessionClient(serviceUrl, null, null);
    111     // TODO print version info of connected BASE server
    112112    System.out.println("Connected to: " + serviceUrl);
    113     System.out.println("BASE Version: TODO");
     113    VersionInfo version = session.getVersion();
     114    System.out.println("BASE Version: " + version.toString());
    114115  }
    115116 
     
    140141  /**
    141142    List all projects that the logged in user is has access to.
     143    The first project found is made the active project.
    142144  */
    143145  public void listProjects()
     
    159161        ProjectInfo info = projects[i];
    160162        ++i;
    161         System.out.println( i + ". " + info.getName() + " [" + info.getId() + "]");
     163        System.out.println( i + ". " + info.getName() + " [id=" + info.getId() + "]");
    162164      }
     165     
     166      System.out.print("Activating project: " + projects[0].getName() + "...");
     167      pc.setActive(projects[0].getId());
     168      System.out.println("Done!");
    163169    }
    164170  }
     
    185191        ExperimentInfo info = experiments[i];
    186192        ++i;
    187         System.out.println( i + ". " + info.getName() + " [" + info.getId() + "]");
     193        System.out.println( i + ". " + info.getName() + " [id=" + info.getId() + "]");
    188194      }
    189195    }
Note: See TracChangeset for help on using the changeset viewer.