Create a session

Once you have the API on your classpath, first create a RAMSession object. This session will be the primary interface to the Rational Asset Manager server. To do this you can use the public constructor passing in the web services Repository location URL found in the Web Services section on the Help > Extensions page of your Rational Asset Manager web client along with a login id and password.

For example:

                   // Create a connection to Rational Asset Manager
                   RAMSession session = new RAMSession(
                   "http://ramsrvr.test.com:8080/ram.ws",
                   "mylogin", "mypassword");
Note:
In version 7.5 and later, you can use a web or web services URL when creating initial connections to Rational Asset Manager. This example uses a web URL:
RAMSession session = new RAMSession("http://servert:8080/ram", "user", "pass");

Alternatively, if you run as an Eclipse plug-in you can create a session object from a repository connection created with the Eclipse client tool. To do this you need to call RichClientCorePlugin.createClientSession(RepositoryIdentification, boolean)

                // Create a connection to Rational Asset Manager
                final String URL = "http://ramsrvr.test.com:8080/ram.ws";
                final String USERID = "mylogin";
                
                RepositoryIdentification id = new RepositoryIdentification(null, URL, USERID);
                
                RAMSession session = RichClientCorePlugin.getDefault().createClientSession(id);
                
  • Create configuration parameters for the URL, user ID, and password:
    			String ramURL = "http://localhost:8080/ram.ws";
    			String ramUserID = "admin";
    			String ramPassword = "admin";
    			String queryParam = null;
  • Create a session:
    RAMSession session = new RAMSession(ramURL, ramUserID, ramPassword);
    You can also create a session on behalf of a user. To do so, create the session with repository administrator login credentials and specify a user ID in the OnBehalfOfUserID parameter. All subsequent API calls are made as if they were made by the specified user.
    RAMSession session = new RAMSession(ramURL, ramAdminUserID, ramAdminpassword, onBehalfOfUserId)
    For more information, see the RAMSession class.

Feedback