<moya xmlns="http://moyaproject.com"
      xmlns:rpc="http://moyaproject.com/jsonrpc"
      xmlns:let="http://moyaproject.com/let">

    <!-- Here's an example JSONRPC interface to get you started. -->

    <!-- Use an enumeration so you can refer to error codes by a label -->
    <enum libname="enum.jsonrpc.errors">
        <value id="1" name="name_too_long">
            This error occurs when you enter a name of more than 10 characters.
        </value>
    </enum>

    <!-- This object creates a view that exposes methods via JSON RPC -->
    <rpc:interface libname="jsonrpc.interface" errors="#enum.jsonrpc.errors">

        <!-- An example of a simple remote method -->
        <rpc:method name="greet" description="Renders a greeting">
            <doc>This method will greet you, using the name of your choice</doc>
            <rpc:parameter name="who" type="string" default="'World'" required="no">
                This parameter should be the name of the person you wish to greet. If not given, the name will default to "World"
            </rpc:parameter>
            <rpc:error code="name_too_long" if="len:who gt 10" data="errortext='What were you thinking?',foo='bar'">
                'who' should be ten characters or less, not '${who}'
            </rpc:error>
            <return>
                <str>Hello, ${who}!</str>
            </return>
        </rpc:method>

    </rpc:interface>


</moya>

