Grid Data Services Client
Contributors: Bill Stephens
caGrid Version: 1.2
Overview
This article focuses on invocation of grid Data Services for Grid client application developers. The instructions are written with the assumption that you will not be building caGrid but only need to obtain the caGrid and Globus Jar files. The code examples, written for the command line, are not specific to any client development framework in order to focus on the functionality that must be implemented rather than actual GUI code.
Invocation of grid services involves the DataServiceClient. This example will log a user into the grid and then invoke a non-secure service and a secure service.
For the purposes of this code we used Training Grid data services.
Non-secure:
http://cagrid01-dev.ahc.umn.edu:18080/wsrf/services/cagrid/CaArraySvc
Secure :
https://128.36.40.78:8443/wsrf/services/cagrid/CaTissueSuite
References
Data Service Client
DataServiceClient Java Doc![]()
Accessing Secure Services
You must configure your Globus installation to trust the certificates of grid that you will be accessing.
Sync with Grid Trust Fabric![]()
You must also set the Globus location as a in the runtime classpath.
Authentication
In order to invoke a secured service on the grid you must obtain grid credentials for your user. The steps for authentication are covered in the Client Developer's Guide to Authentication
.
Discovering Grid Services
You will need to identify avialable grid services on the grid that you are targeting. You can find services using the caGrid Discovery Portal
or https://cabig-kc.nci.nih.gov/CaGrid/KC/index.php/Discovery_for_Client_Developers programmatically
.
Invocation of Grid Services
Non-secure Services
try{ DataServiceClient client =newDataServiceClient(url); CQLQuery query =newCQLQuery();Objecttarget =newObject(); target.setName("edu.georgetown.pir.Organism"); query.setTarget(target); CQLQueryResults results = client.query(query); Utils.serializeDocument("publicResults.xml", results, DataServiceConstants.CQL_RESULT_COLLECTION_QNAME);//standardClient.}catch(MalformedURIException e) {// TODO Display appropriate client errore.printStackTrace(); }catch(RemoteException e) {// TODO Display appropriate client errore.printStackTrace(); }catch(Exception e) {// TODO Display appropriate client errore.printStackTrace(); }
Secure Services
When instantiating the DataServiceClient provide te service URL and Globus Credential for your user.
try{ DataServiceClient client =newDataServiceClient(url, cred); CQLQuery query =newCQLQuery();Objecttarget = newObject(); target.setName("edu.georgetown.pir.Organism"); query.setTarget(target); CQLQueryResults results = client.query(query); Utils.serializeDocument("publicResults.xml", results, DataServiceConstants.CQL_RESULT_COLLECTION_QNAME); } catch(MalformedURIException e) {// TODO Display appropriate client errore.printStackTrace(); } catch(RemoteException e) {// TODO Display appropriate client errore.printStackTrace(); } catch(Exception e) { // TODO Display appropriate client errore.printStackTrace(); }
Example Code
The attached file provides an example command line incovation client and a listing of Globus and caGrid Jar files required to compile and execute the example.





