Created 18 November 2016
The Google Web Toolkit JSON Overlay library provides the JSON Overlays that can be used to access the Web service API for this application.
String url = ...; RequestBuilder request = new RequestBuilder(RequestBuilder.GET, url); request.sendRequest(null, new RequestCallback() { public void onResponseReceived(Request request, Response response) { if (200 == response.getStatusCode()) { //handle the successful data... SPINResults data = SPINResults.fromJson(response.getText()); //handle the SPINResults... } else { //handle the error... } } public void onError(Request request, Throwable throwable) { //handle the error... } });
name | size | description |
---|---|---|
spinengine-gwt-json-overlay.jar | 1.53K | The sources for the GWT JSON overlay. |
Created 18 November 2016
The Java client-side library is used to provide the set of Java objects that can be serialized to/from JSON using Jackson. This is useful for accessing the JSON REST endpoints that are published by this application.
java.net.URL url = new java.net.URL(baseURL + "/executeDEMRules"); ObjectMapper mapper = new ObjectMapper(); java.net.URLConnection connection = url.openConnection(); connection.setDoOutput(true); connection.connect(); mapper.writeValue(connection.getOutputStream(), dEMRequest); SPINResults result = (SPINResults) mapper.readValue( connection.getInputStream(), SPINResults.class ); //handle the result as needed...
javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient(); SPINResults result = client.target(baseUrl + "/executeDEMRules") .post(javax.ws.rs.client.Entity.entity(dEMRequest, "application/json"), SPINResults.class); //handle the result as needed...
name | size | description |
---|---|---|
spinengine-json-client.jar | 1.90K | The binaries for the Java JSON client library. |
spinengine-json-client-json-sources.jar | 1.66K | The sources for the Java JSON client library. |
Created 18 November 2016
The JavaScript client-side library defines classes that can be (de)serialized to/from JSON. This is useful for accessing the resources that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").
The library uses ES6 class syntax which has limited support. See MDN and the ES6 Compatibility Table for more details.
The library contains a UMD loader which supports AMD, CommonJS and browser globals. The browser global variable name for this library is "javascriptClient".
//read the resource in JSON: var json = JSON.parse(jsonString); //create an object var object = new Object(json); //retreive the json again var newJson = object.toJSON(); //serialize the json var newJsonString = JSON.stringify(newJson);
name | size | description |
---|---|---|
spinengine-js.zip | 1.66K |
Created 18 November 2016
The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON. This is useful for accessing the resources that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").
This library requires the json_encode function which was included in PHP versions 5.2.0+.
//read the resource in JSON: $json = ...; //read the json as an array. $parsed = json_decode($json, true); //read the json array as the object $result = new Object($parsed); //open a writer for the json $json = $result->toJson();
name | size | description |
---|---|---|
spinengine-php.zip | 1.50K |
Created 18 November 2016
The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON. This is useful for accessing the REST endpoints that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").
This library leverages the Ruby JSON Implementation, which is required in order to use this library.
require 'net/https' require 'uri' //... //read a resource from a REST url url = URI.parse("...") request = Net::HTTP::Post.new(url.request_uri) input = Object.new //set up the Object... request.body = input.to_json request['Content-Type'] = "application/json" http = Net::HTTP.new(url.host, url.port) //set up additional http stuff... res = http.start do |ht| ht.request(request) end result = Object.from_json(JSON.parse(res.body)) //handle the result as needed...
name | size | description |
---|---|---|
spinengine.rb | 13.67K |