On Jul 1, 12:32 am, Krull <
christer.wik...@gmail.com> wrote:
> I was playing around with the json-rpc and it works really fine, but I
> missing client side examples on how to invoke my spring services. Can
> someone provide me with some simple java script examples? Maybe also
> update the example on the first page with the client side...
quick and dirty example that uses prototype's AJAX library:
var jsonRpcRequest = {
"jsonrpc": "2.0",
"method": "round",
"id": "whatever",
"params": [1124124.1241]
};
new Ajax.Request("
http://www.example.com/RoundingService.json", {
asynchronous: false,
method: "POST",
postBody: jsonRpcRequest,
contentType: "application/json",
requestHeaders: { "Accept": "application/json" },
onSuccess: function(transport) {
alert(transport.responseText);
},
onFailure: function(transport) {
alert("ERROR!\n"+transport.responseText);
}
});
We're working on a java client.