Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tuscany supports JSON-RPC as a protcol for use with SCA services by using the <binding.jsonrpc> SCDL extensionelement in your Application composite. This enables remote web browser clients to easily make RPC style calls to server-side SCA components.The complete timeline of available and future plans is given in the Tuscany Web 2.0 Roadmap

User Stories

  • A web browser client application invoke a remote SCA Service using JSON-RPC and the invocation return business objects in JSON format. (tick)
    • e.g. Retrieve catalog items
  • A SCA component can define a reference to a remote SCA Service and use JSON-RPC for the invocation. (tick)
    • e.g. A catalog aggregator invoke various catalog services using JSON-RPC and aggregate the returned items into a single response
  • A client application invoke a SCA Service using JSON-RPC and the invocation returns a business exception. (tick)
    • e.g. Empty catalog throws a Busines Exception. Business Exception should properly propagate and display nicely to client.
  • A client application invoke a SCA Service using JSON-RPC and the invocation returns a runtime exception. (tick)
    • e.g. Try to retrieve catalog items from a catalog service that is un-available. Runtime exception properly propagate and display nicely to client.
  • A client application needs to access a service exposed trough JSON-RPC binding that requires authentication.
    • e.g. make sure if nobody can get to the catalog if it's not authenticated

Using the Tuscany JSON-RPC binding

You could use this binding without any configuration, or by providing a specific service URI.
To include it on a SCA service or Reference, choose one of the SCDL examples below :

Code Block

<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
            <bindingxmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
           ...

	   <tuscany:binding.jsonrpc/>
Code Block

<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
           xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
           ...

   <binding.jsonrpc uri="http://localhost:8080/store/catalog"/>

...