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

ISO 21090


ISO Datatype: Introduce Tutorial 1.3


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. This tutorial covers 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. From the Help menu, choose Introduce Software Update. Copy and paste the following into the "Update Site" field:
    http://software.cagrid.org

    . Then click the Look For Updates button to retrieve a list of updates from the update site.

  3. Check the ISO21090 Datatypes and NCI localizations and click Next
  4. Introduce proceeds to download and install the extension. Click Next and then Finish to restart Introduce.
  5. Once Introduce re-launches, click Modify Service and open the service previously created.
  6. The Import Data Types area under the Add/Remove Types tab now has a ISO21090 tab. Click on it
  7. Click the Add button to add the ISO21090 data types to the service. These will now be listed on the left side column
  8. Let us now 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.
  9. We 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
  10. Click Save to save the service.

Implementation


  1. Next we will implement the client and server side code.
    • In your service directory, open the following file in a text editor: C:/../ServiceName/src/org/cagrid/ServiceName/client/ServiceNameClient.java.
    • Copy and past the following imports in the beginning of the file:
      import org.iso._21090.Ad;
      import org.iso._21090.NullFlavor;
      import org.iso._21090.ObjectFactory;
      
    • Find the Main method. After:
           // place client calls here if you want to use this main as a
           // test....
      

      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());
      
    • Save the file.
    • Now open the following file: C:/.../ServiceName/src/org/cagrid/ServiceName/service/ServiceNameImpl.java.
    • Copy and past the following imports in the beginning of the file:
      import org.iso._21090.Ad;
      import org.iso._21090.NullFlavor;
      import org.iso._21090.ObjectFactory;
      
    • Replace
          //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;
      
    • Save the file.

Deploy the Service


  1. Next we deploy the service to a container. For complete details on deployment, please see the Grid Service Deployment Guide.
    • If you have closed Introduce, restart it from a command prompt:

      %> cd %CAGRID_HOME%
      %> ant introduce

    • Click Deploy Service and browse to your service directory.
    • Choose a container (Tomcat is recommended) and configure other settings if needed. Refer to the Grid Service Deployment Guide for complete details.
    • Click Deploy
  2. 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.

Last edited by
Sarah Honacki (1076 days ago)
Adaptavist Theme Builder Powered by Atlassian Confluence