Bookmark and Share Share

Deploying, Testing or Invoking Mashups

Before you can test or invoke a mashup, you must deploy the mashup script to the EMML Reference Runtime Engine. See Deploying Mashups in the EMML Engine for instructions.

You can then test the mashup service using the command line utility provided in the EMML/EMML Reference Runtime Engine package. See Testing Mashups from a Command Line for instructions.

You invoke a mashup service as a REST web service with a simple URL. See URLs for Mashup Services and Invoking Mashups at Runtime for more information.

URLs for Mashup Services

The full syntax for mashup service URLs is:

http://host:port/emml/mashup-file-without-extension[/operation-name][?param-name=value&param-name=value...]

If the mashup has been registered with the EMML Engine, you can use the logical name of the mashup rather than the file name. See Deploying Mashups in the EMML Engine for instructions on registering mashups. Both of the following URLs are valid for the sample mashup rssfilter.emml:

http://localhost:8080/emml/rssfilter

http://localhost:8080/emml/YahooHotJobsFilter

If the mashup has an <operation> statement with an operation name, specify the operation after the mashup service name. For example:

http://localhost:8080/emml/rsssort/sort

If the mashup has input parameters, specify them after a ? in the form param=value. For example:

http://localhost:8080/emml/rsssort/sort?jobDescription=Haskel

Note: you can only specify input parameters that have simple values. Although EMML supports complex input parameters (a document type), the does not support this.

Deploying Mashups in the EMML Engine

To deploy a mashup script in the EMML Engine, simply copy the EMML file to web-apps-home/emml/WEB-INF/classes.

If the mashup service should be accessible by both its file name and its logical name, you must also register the mashup script with the EMML Engine:

  1. Open the mashups.xml file in the web-apps-home/emml/WEB-INF/classes folder with any XML or text editor.

    This configuration file initially lists the sample mashup scripts installed with the EMML Engine.

  2. Add a <mashup> element and enter the name of your mashup script in the script attribute. For example

    <mashups> 
      <mashup script="rssfilter.emml"/> 
      <mashup script="annotate.emml"/> 
      <mashup script="amazonrest.emml"/> 
    ... 
      <mashup script="myMashup.emml"/> 
    </mashups>
    
  3. Restart the EMML Engine.

Testing Mashups from a Command Line

To test a mashup you have deployed:

  1. If you did not add emmlclient.class to your classpath or added this utility class to the web-apps-home/emml/WEB-INF/classes folder during installation, do so now.

  2. Open a command window and move to the folder with emmlclient.class.

  3. Enter a command in this form:

    java emmlclient url-for-mashup

    For example, the URL for the sample mashup script rssfilter.emml deployed in a EMML Engine on the local host would be:

    http://localhost:8080/emml/rssfilter.

    See URLs for Mashup Services for more details.

Output from debugging messages, errors or the successful result of the mashup display in the command window. See Supporting Debugging for links and information on EMML statements you can use for debugging.

Invoking Mashups at Runtime

You invoke mashup services as a REST service using a URL with the mashup file name or logical name. See URLs for Mashup Services for details.

For example, http://localhost:8080/emml/rssfilter is the URL for the sample mashup script rssfilter.emml deployed in a EMML Engine on the local host. URLs can also include operation names and parameters, as needed.

Mashup services return results in XML format.