Access Keys:
Skip to content (Access Key - 0)

ISO 21090


ISO Datatype: Introduce Tutorial 1.4


Author: Calixto Melean

Contents

Overview


The purpose of this document is to illustrate how to create an analytical service using Introduce and the ISO21090 data type extension. The tutorial explains both how to install the extension using the software update tool and how to use the extension to create a simple analytical service.

SVN Checkout


The completed service in this tutorial is available from SVN repository and can be checked out through anonymous access with the following command:

Graphical Use


1. Launch Introduce and click the Create Service Skeleton button. Enter service information and click the Create button.
2. In the Import Data Types area under the Add/Remove Types tab, click the ISO21090 tab.
3. Click the Add button to add the ISO21090 data types to the service. These will now be listed on the left column.

4. Next, add an operation to the service using one of the ISO21090 types. Click the Services tab. Click Operations and then the Add Method button to the right.

5. Define a sendAd operation that takes an Ad object as input and returns an Ad object as output:

  • Type "sendAd" for Method Name.
  • Type "Send ISO address to the service" for the Method Description.
  • For the Inputs tab, double-click Ad from the left.
  • Click the Outputs tab. Double-click Ad from the left. Click the Done button.

6. Click Save to save the service.

Implementation


Next, implement the client and server-side code:

1. In the service directory, open the following file in a text editor:

  • C:/../ServiceName/src/org/cagrid/ServiceName/client/ServiceNameClient.java.

2. Copy and paste the following imports in the beginning of the file:

import org.iso._21090.Ad;
import org.iso._21090.NullFlavor;
import org.iso._21090.ObjectFactory;

3. Find the Main method.

     // place client calls here if you want to use this main as a
     // test....

4. Then copy and paste the following:

     org.iso._21090.ObjectFactory factory = new ObjectFactory();
     Ad ad = factory.createAd();
     ad.setFlavorId("Testing flavor Id");
     ad.setNullFlavor(NullFlavor.DER);
     ad.setControlActExtension("123456789");
     Ad returnAd = client.sendAd(ad);

     System.out.println(returnAd.getFlavorId());
     System.out.println(returnAd.getNullFlavor());
     System.out.println(returnAd.getControlActExtension());

5. Save the file.
6. Open the following file:

  • C:/.../ServiceName/src/org/cagrid/ServiceName/service/ServiceNameImpl.java.

7. Copy and paste the following imports in the beginning of the file:

import org.iso._21090.Ad;
import org.iso._21090.NullFlavor;
import org.iso._21090.ObjectFactory;

8. Replace this:

    //TODO: Implement this autogenerated method
    throw new RemoteException("Not yet implemented");

with this:

      System.out.println("server: " + ad.getFlavorId());
      System.out.println("server: " + ad.getNullFlavor());
      System.out.println("server: " + ad.getControlActExtension());
      return ad;

9. Save the file.

Deploy the Service


Next, deploy the service to a container. For complete details on deployment, please see the Grid Service Deployment Guide.

  • If Introduce is closed, restart it from a command prompt:
     %> cd %CAGRID_HOME% %> ant introduce
    
  • Click Deploy Service and browse to the service directory.
  • Choose a container (Note: Tomcat is recommended) and configure other settings if needed. Refer to the aforementioned Grid Service Deployment Guide for complete details.
  • Click Deploy

Start the Tomcat container with a command prompt.

 %> cd %CATALINA_HOME%\bin %> startup.bat

Verify


Run the test client to verify that the service is working.

  • In a command prompt:
     %> cd <location of service> %> ant runClient
    
  • Alternatively, verify by opening a web browser and entering the service's URL: "http://localhost:8080/wsrf/services/cagrid/ISO21090AnalyticalService". You should see the following:
Last edited by
Clayton Clark (1025 days ago) , ...
Adaptavist Theme Builder Powered by Atlassian Confluence