Friday 26 June 2009

JSON-RPC services

Recently I had to implement a JSON-RPC (http://json-rpc.org/) for integration with some other system. First I tried to use the new WCF's new capability to work with JSON data, but this was a painful experience. After a full day of getting NullReferenceExceptions without any reasonable error message, I gave up. Let’s face it, a library that gives your NullReferenceException only because you misconfigured something is crap and shouldn’t be used in production environment.

Then one of my colleagues recommended JayRock (http://jayrock.berlios.de/) open source framework – and here the experience was completely different! After some 15 minutes I had the web service up and running. This framework gives you the (old school) IHttpHandler which not only automagically exposes all the methods you need, but also gives you a neat http test page, where you can see all the methods implemented on the service and run them. It is easy to reverse-engineer the java script from these pages and include them in your web site. Strongly recommended!

No comments: