Version 1 (modified by jean-gui, 5 years ago)


The Contract

The contract is an XML file used to describe the observer's capabilites and how Unicorn can call it. It uses the  WADL format which is a machine process-able description of such HTTP-based Web applications.

This contracts gives several information to Unicorn:

  • possible input methods of the observer (input by URI, by text or by file)
  • possible parameters for each input method
  • types of these parameters


<?xml version="1.0"  encoding="utf-8"?>

<application xmlns:xsi=""

                        <doc title="responseType">default</doc>
                        <doc xml:lang="en" title="name">W3C HTML Validator</doc>
                        <doc xml:lang="fr" title="name">W3C Validateur HTML</doc>
                        <doc title="mimetype">text/html</doc>
                        <doc title="mimetype">application/xhtml+xml</doc>
                        <doc title="mimetype">image/svg+xml</doc>
                        <doc title="mimetype">application/mathml+xml</doc>
                        <doc title="mimetype">application/smil+xml</doc>
                        <doc title="paramOutput">output</doc>

    <resources base="http://localhost/">
      <resource uri="calculator.php">
        <method name="GET" id="CalculatorGET">

                                <doc title="inputMethod">URI</doc>
                                <doc title="inputParamName">url</doc>
            <query_variable name="uri" />
            <query_variable name="x2" type="xs:boolean"/>