JSON-RPC 2.0 Base flies with the new JSON library

Two years after its initial release the JSON-RPC 2.0 Base library switches to a new package for representing and parsing JSON messages. The result is 2x to 4x times faster performance in JSON-RPC message parsing! Back in 2009 I chose JSON Simple for its simple and relatively non-invasive model for representing and mapping JSON entities […]

Detecting CORS support in a browser

I’m using the following JavaScript function to detect whether a browser has support for Cross-Origin Resource Sharing (CORS) XHR. function browserSupportsCors() { if (“withCredentials” in new XMLHttpRequest()) return true; else if (window.XDomainRequest) return true; else return false; } The XDomainRequest object is specific to IE 8 and IE9, other browsers, including IE 10, extend the […]

JSON-RPC 2.0 Base with thread-safe parsing

Just when you think a piece of software has stabilised and there’s nothing more to add or change and something crops up to disturb this 🙂 The other day I received a report by Giancarlo Barresi, who had observed concurrency problems with the JSON-RPC 2.0 Base library under heavy load. It turned out that my […]

Search filter checking method added to the LDAP web service

The latest 1.8.1 release of the directory web service Json2Ldap adds a new JSON-RPC method for validating search filters. It can be used for example to check user input filter strings before making an actual ldap.search request. This is a simple utility method that takes just one parameter – the filter string. Note that an […]

How to debug CORS requests with Firebug

Firebug, the indispensable Firefox add-on for serious developers, is great for debugging web apps that make use of the new CORS mechanism for cross-domain requests. The acronym CORS stands for Cross-Origin Resource Sharing and was developed by a group of web activists to address the issue of making browser cross-domain requests in a standards-compliant way. […]

Sending JSON-RPC 2.0 requests with jQuery

Dispatching JSON-RPC 2.0 – style requests with jQuery is easy. Just use the jQuery.post() method: var url = “http://rpc-service.net/jsonrpc2/”; var request = {}; request.method = “ldap.search”; request.params = {}; request.params.CID = “45d0677d-a336-463b-ad99-c82137d03a00”; request.params.baseDN = “ou=people,dc=example,dc=com”; request.params.scope = “ONE”; request.params.filter = “(givenName=John)”; request.id = 1; request.jsonrpc = “2.0”; function displaySearchResult(response) { if (response.result) alert(response.result); else if […]