Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Using JSON in Titan part III: JSON RPC(JSON RPC 2.0 TTCN-3 implementation)
Using JSON in Titan part III: JSON RPC [message #1707756] Wed, 09 September 2015 07:19
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Greetings,

JSON RPC ( as stated on http://www.jsonrpc.org/specification ) "is a stateless, light-weight remote procedure call (RPC) protocol.
Primarily this specification defines several data structures and the rules around their processing.
It is transport agnostic in that the concepts can be used within the same process, over sockets, over http, or in many various message passing environments."

For a complete picture, the JSON schemas for JSON RPC 2.0 can be found at https://github.com/fge/sample-json-schemas/tree/master/jsonrpc2.0

Let's assume that we need to connect Titan to a node over JSON RPC.
The workflow is not any different from the one described in the first part.
The attached file JSON_RPC.ttcn contains the TTCN-3 type declarations (and encoding instructions) equivalent to the structures described in the JSON schema.
The codec declarations in form of external functions will trigger Titan to generate the C++ code , without any further intervention being needed from the user.

The control part contains a number of templates to be encoded/decoded in loop, and charstring samples containing encoded JSON RPC messages (taken form the specification website)
to be decoded. The results can be followed in the generated log.

All that remains is to chose the appropriate transport to convey these JSON RPC messages.


The Makefile can be generated with:

makefilegen -s -e json JSON_RPC.ttcn

and the executable can be run in single mode:

./json


Enjoy.

N.B. The Titan I used is slightly ahead of the binaries published on the Eclipse download site (and github) so those binaries will behave a bit differently, and throw some errors when decoding some constructs.
We are aiming for a new release in November.
Titan is being continuously developed: new features are added,
trouble reports corrected etc. The release notes document will contain changes from release to release.
Previous Topic:Titan on Windows 7 with MSVC??
Next Topic:Titan course material
Goto Forum:
  


Current Time: Sat Apr 20 06:50:19 GMT 2024

Powered by FUDForum. Page generated in 0.03216 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top