October 24, 2008

Update Asset Attribute Value Using Rational Asset Manager Web Service

by Dileep K Sharma 1 comments



Share this post:
Design Float | StumbleUpon | Reddit

Rational Asset Manager publishes Web services that allow you to work with the repository. Use the Rational Asset Manager Web Services Descriptor Language (WSDL) file to develop custom applications that interact with the Rational Asset Manager server. Here is an example code using client API to interact with Rational Asset Manager from a Java application. Make sure you include all required jars in class path. Use the API found in the Rational Asset Manager Javadoc located in the Reference section of the help.

package ram.update.asset.data;
import org.eclipse.core.runtime.NullProgressMonitor;
import com.ibm.ram.client.RAMAsset;
import com.ibm.ram.client.RAMSession;
import com.ibm.ram.common.data.AssetAttribute;
import com.ibm.ram.common.data.SearchQuery;
import com.ibm.ram.common.data.SearchResult;

public class UpdatedAssetAttribute {
public static void main(String[] args) {
RAMSession session;
session = new RAMSession(
"http://RAM_SERVER/com.ibm.ram.web.ws",
"USERNAME", "PASSWORD");
SearchQuery sQuery = session.createAssetQuery("ramSearch:(1fGroup,COMMUNITY)");
SearchResult searchResult = session.getAssets(sQuery);
RAMAsset[] queryAssets = (RAMAsset[]) searchResult.getAssets();
System.out.println("RAM Assets Query results::" + queryAssets.length);
for (int j = 0; j <>
try {
AssetAttribute attribute = queryAssets[j].getAssetAttribute("ATTRIBUTE_NAME");
attribute.setValues(new String[] { "NEW_VALUE" });
session.queueAssetForPut(queryAssets[j]);
session.putAssets(new NullProgressMonitor());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
}

Comments 1 comments
CarlosF said...

There are 3 other APIs that RAM v7.1 provides. These include:
1. The commandline ANT Task api for integrating with deployment, build scripts or test scripts. 2. The Policy Java API on the server for writing policies.
3. The Java Client API on the client.

Post a Comment

Dileep K Sharma
Engineer, IT Professional, Graphics Designer, Critic
New Delhi, INDIA
dileepksharma@gmail.com

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Recent Entries

Advertise on this site Sponsored links

Categories

Sponsored Links

My Photos on flickr

Subscribe feeds rss Recent Comments

Technorati

Technorati
My authority on technorati

Add   to Technorati Favorites