Request

A request operation adds data needed to process a transaction.

Example XML code Notes

<request 
  name="FirstDivisor"
  service="Expr"  
  fields="n">
  <prop 
    name="expr.src" 
    content-type="text/x-erlang"><![CDATA[
put("div", 2),
"Ok".
  ]]></prop>
  <reply 
    name="Ok"
    fields="div"/>
</request>
A request receives one or more fields from SPARKL and sends a reply based on the input.

There can be more than one reply to a request. Every time the operation is invoked, it sends only one reply. Each reply can add one or more fields.

For example, whenever it is invoked, FirstDivisor sends the field div with the value 2.

Attributes

A request operation must have a name, a service that implements it, and some fields the operation asks for as input.

name

The name of the component. Other components use this name to reference the component.

service

The service that implements the operation. The implementing service is referenced by its name.

fields

A space-separated list of fields received or output by the operation subject. Depending on the type of operation, they can be input or output fields. The fields are referenced by their name.

Children

A request must take one or more replies as its children. Depending on the service specified for it, the request can have one or more properties for additional functionality or field bindings too.

prop

A property can contain a script, bind fields to parameters, and so on. Most properties are specific to a SPARKL extension.

reply

A reply is a direct child of a request operation. A reply must have a name and it has to reference one or more fields it uses to carry the newly-generated data.