Created September 27, 2023
The C module generates the source code for the ANSI-C-compatible data structures and (de)serialization functions that can be used in conjunction with libxml2 to (de)serialize the REST resources as they are represented as XML data.
The generated C source code depends on the XML Reader API
and the XML Writer API as well as the <time.h>,
<string.h>, and <stdlib.h> C standard libraries.
#include <nfc-webservice-api.c>
//...
xmlTextReaderPtr reader = ...; //set up the reader to the url.
nfc_webservice_api_ns0_dnaApiResult *response_element = ...;
response_element = xml_read_nfc_webservice_api_ns0_dnaApiResult(reader);
//handle the response as needed...
//free the nfc_webservice_api_ns0_dnaApiResult
free_nfc_webservice_api_ns0_dnaApiResult(response_element);
| name | size | description |
|---|---|---|
| nfc-webservice-api.c | 45.42K | The C module generates the source code for the ANSI-C-compatible data structures and (de)serialization functions that can be used in conjunction with libxml2 to (de)serialize the REST resources as they are represented as XML data.
The generated C source code depends on the XML Reader API
and the XML Writer API as well as the C Example
#include <nfc-webservice-api.c>
//...
xmlTextReaderPtr reader = ...; //set up the reader to the url.
nfc_webservice_api_ns0_dnaApiResult *response_element = ...;
response_element = xml_read_nfc_webservice_api_ns0_dnaApiResult(reader);
//handle the response as needed...
//free the nfc_webservice_api_ns0_dnaApiResult
free_nfc_webservice_api_ns0_dnaApiResult(response_element);
|
| enunciate-common.c | 40.50K | Common code needed for all projects. |
Created September 27, 2023
The C# client-side library defines the classes that can be (de)serialized to/from XML. This is useful for accessing the HTTP resources that are published by this application.
//read a resource from a REST url
Uri uri = new Uri(...);
XmlSerializer s = new XmlSerializer(
typeof( byte[] )
);
//Create the request object
WebRequest req = WebRequest.Create(uri);
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
TextReader r = new StreamReader( stream );
byte[] result = (byte[]) s.Deserialize( r );
//handle the result as needed...
| name | size | description |
|---|---|---|
| nfc-webservice-api-csharp-xml-client.zip | 1.09K | The C# source code for the C# client library. |
Created September 27, 2023
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...
DnaApiResult data = DnaApiResult.fromJson(response.getText());
//handle the DnaApiResult...
}
else {
//handle the error...
}
}
public void onError(Request request, Throwable throwable) {
//handle the error...
}
});
| name | size | description |
|---|---|---|
| nfc-webservice-api-gwt-json-overlay.jar | 1.76K | The sources for the GWT JSON overlay. |
Created September 27, 2023
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 + "/v1/dna/check/{tag}");
ObjectMapper mapper = new ObjectMapper();
java.net.URLConnection connection = url.openConnection();
connection.connect();
DnaApiResult result = (DnaApiResult) mapper.readValue( connection.getInputStream(), DnaApiResult.class );
//handle the result as needed...
javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient();
DnaApiResult result = client.target(baseUrl + "/v1/dna/check/{tag}")
.get(DnaApiResult.class);
//handle the result as needed...
| name | size | description |
|---|---|---|
| nfc-webservice-api-json-client.jar | 2.32K | The binaries for the Java JSON client library. |
| nfc-webservice-api-json-client-json-sources.jar | 1.65K | The sources for the Java JSON client library. |
Created September 27, 2023
The Java client-side library is used to access the Web service API for this application using Java.
The Java client-side library is used to provide the set of Java objects that can be serialized to/from XML using JAXB. This is useful for accessing the resources that are published by this application.
java.net.URL url = new java.net.URL(baseURL + "/v1/dna/check/{tag}");
JAXBContext context = JAXBContext.newInstance( byte[].class );
java.net.URLConnection connection = url.openConnection();
connection.connect();
Unmarshaller unmarshaller = context.createUnmarshaller();
DnaApiResult result = (DnaApiResult) unmarshaller.unmarshal( connection.getInputStream() );
//handle the result as needed...
javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient();
DnaApiResult result = client.target(baseUrl + "/v1/dna/check/{tag}")
.get(DnaApiResult.class);
//handle the result as needed...
| name | size | description |
|---|---|---|
| nfc-webservice-api-xml-client.jar | 2.65K | The binaries for the Java XML client library. |
| nfc-webservice-api-xml-client-xml-sources.jar | 2.10K | The sources for the Java XML client library. |
Created September 27, 2023
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 |
|---|---|---|
| nfc-webservice-api-javascript-client-js.zip | 1.52K | 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". JavaScript Example
//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);
|
Created September 27, 2023
| name | size | description |
|---|---|---|
| ns0.xsd | 1.86K |
Created September 27, 2023
The Objective C module generates the source code for the Objective C classes and (de)serialization functions that can be used in conjunction with libxml2 to (de)serialize the REST resources as they are represented as XML data.
The generated Objective C source code depends on the XML Reader API and the XML Writer API as well as the base OpenStep foundation classes.
#import <nfc-webservice-api.h>
//...
NFC_WEBSERVICE_APINS0DnaApiResult *responseElement;
NSData *responseData; //data holding the XML from the response.
NSURL *baseURL = ...; //the base url including the host and subpath.
NSURL *url = [NSURL URLWithString: @"/v1/dna/check/{tag}" relativeToURL: baseURL];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
NSURLResponse *response = nil;
NSError *error = NULL;
[request setHTTPMethod: @"GET"];
//this example uses a synchronous request,
//but you'll probably want to use an asynchronous call
responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NFC_WEBSERVICE_APINS0DnaApiResult *responseElement = [NFC_WEBSERVICE_APINS0DnaApiResult readFromXML: responseData];
[responseElement retain];
//handle the response as needed...
| name | size | description |
|---|---|---|
| nfc-webservice-api.h | 2.74K | The Objective C module generates the source code for the Objective C classes and (de)serialization functions that can be used in conjunction with libxml2 to (de)serialize the REST resources as they are represented as XML data. The generated Objective C source code depends on the XML Reader API and the XML Writer API as well as the base OpenStep foundation classes. Objective C Example
#import <nfc-webservice-api.h>
//...
NFC_WEBSERVICE_APINS0DnaApiResult *responseElement;
NSData *responseData; //data holding the XML from the response.
NSURL *baseURL = ...; //the base url including the host and subpath.
NSURL *url = [NSURL URLWithString: @"/v1/dna/check/{tag}" relativeToURL: baseURL];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
NSURLResponse *response = nil;
NSError *error = NULL;
[request setHTTPMethod: @"GET"];
//this example uses a synchronous request,
//but you'll probably want to use an asynchronous call
responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NFC_WEBSERVICE_APINS0DnaApiResult *responseElement = [NFC_WEBSERVICE_APINS0DnaApiResult readFromXML: responseData];
[responseElement retain];
//handle the response as needed...
|
| nfc-webservice-api.m | 33.90K | The Objective C module generates the source code for the Objective C classes and (de)serialization functions that can be used in conjunction with libxml2 to (de)serialize the REST resources as they are represented as XML data. The generated Objective C source code depends on the XML Reader API and the XML Writer API as well as the base OpenStep foundation classes. Objective C Example
#import <nfc-webservice-api.h>
//...
NFC_WEBSERVICE_APINS0DnaApiResult *responseElement;
NSData *responseData; //data holding the XML from the response.
NSURL *baseURL = ...; //the base url including the host and subpath.
NSURL *url = [NSURL URLWithString: @"/v1/dna/check/{tag}" relativeToURL: baseURL];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
NSURLResponse *response = nil;
NSError *error = NULL;
[request setHTTPMethod: @"GET"];
//this example uses a synchronous request,
//but you'll probably want to use an asynchronous call
responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NFC_WEBSERVICE_APINS0DnaApiResult *responseElement = [NFC_WEBSERVICE_APINS0DnaApiResult readFromXML: responseData];
[responseElement retain];
//handle the response as needed...
|
| enunciate-common.h | 12.83K | Common header needed for all projects. |
| enunciate-common.m | 42.34K | Common implementation code needed for all projects. |
Created September 27, 2023
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 |
|---|---|---|
| nfc-webservice-api-php-json-client-php.zip | 1.35K | 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+. PHP JSON Example
//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();
|
Created September 27, 2023
The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML. This is useful for accessing the resources that are published by this application, but only those that produce a XML representation of their resources.
This library leverages the XMLReader and XMLWriter tools that were included in PHP versions 5.1.0+.
//read the resource in XML form:
$xml = ...;
$reader = new \XMLReader();
if (!$reader->open($xml)) {
throw new \Exception('Unable to open ' . $xml);
}
$result = new Object($reader);
//open a writer for the xml
$out = ...;
$writer = new \XMLWriter();
$writer->openUri($out);
$writer->startDocument();
$writer->setIndent(4);
$result->toXml($writer);
$writer->flush();
| name | size | description |
|---|---|---|
| nfc-webservice-api-php-xml-client-php.zip | 2.39K | The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML. This is useful for accessing the resources that are published by this application, but only those that produce a XML representation of their resources. This library leverages the XMLReader and XMLWriter tools that were included in PHP versions 5.1.0+. PHP XML Example
//read the resource in XML form:
$xml = ...;
$reader = new \XMLReader();
if (!$reader->open($xml)) {
throw new \Exception('Unable to open ' . $xml);
}
$result = new Object($reader);
//open a writer for the xml
$out = ...;
$writer = new \XMLWriter();
$writer->openUri($out);
$writer->startDocument();
$writer->setIndent(4);
$result->toXml($writer);
$writer->flush();
|
Created September 27, 2023
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::Get.new(url.request_uri)
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 |
|---|---|---|
| nfc-webservice-api.rb | 12.60K | 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. Ruby JSON Example
require 'net/https'
require 'uri'
//...
//read a resource from a REST url
url = URI.parse("...")
request = Net::HTTP::Get.new(url.request_uri)
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...
|