...
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.
- e.g. Retrieve catalog items
- A SCA component can define a reference to a remote SCA Service and use JSON-RPC for the invocation.
- 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.
- 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.
- 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"/>
|
...