Files and Libraries
The following files and libraries are available:
- License
- C Client Library
- .NET Client Library
- Java Client Library
- Java JSON Client Library
- Objective C Client Library
License
Created Dec 9, 2012 4:03:00 AM
The license file governing the use of this API.
Files
| name | size |
|---|---|
| LICENSE.txt | 4.96K |
C Client Library
Created Apr 25, 2013 4:14:46 AM
Introduction
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.
REST XML Example
#include <agentrank.c>
//...
xmlTextReaderPtr reader = ...; //set up the reader to the url.
agentrank_ns0_getMarket *response_element = ...;
response_element = xml_read_agentrank_ns0_getMarket(reader);
//handle the response as needed...
//free the agentrank_ns0_getMarket
free_agentrank_ns0_getMarket(response_element);
Files
| name | size | description |
|---|---|---|
| agentrank.c | 794.68K | |
| enunciate-common.c | 39.70K | Common code needed for all projects. |
.NET Client Library
Created Apr 25, 2013 4:14:51 AM
Introduction
The .NET client-side library defines the classes that can be (de)serialized to/from XML. This is useful for accessing the REST endpoints that are published by this application.
REST Example
//read a resource from a REST url
Uri uri = new Uri(...);
XmlSerializer s = new XmlSerializer(
typeof( GetMarket )
);
//Create the request object
WebRequest req = WebRequest.Create(uri);
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
TextReader r = new StreamReader( stream );
GetMarket order = (GetMarket) s.Deserialize( r );
//handle the result as needed...
This bundle contains C# source code.
Files
| name | size |
|---|---|
| agentrank-dotnet.zip | 8.02K |
Java Client Library
Created Apr 25, 2013 4:14:51 AM
Introduction
The Java client-side library is used to access the Web service API for this application.
The JAX-WS 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 REST endpoints that are published by this application.
REST Example (Raw JAXB)
java.net.URL url = new java.net.URL(baseURL + "/market/view/{context}");
JAXBContext context = JAXBContext.newInstance( GetMarket.class );
java.net.URLConnection connection = url.openConnection();
connection.connect();
Unmarshaller unmarshaller = context.createUnmarshaller();
GetMarket result = (GetMarket) unmarshaller.unmarshal( connection.getInputStream() );
//handle the result as needed...
REST Example (Jersey client)
com.sun.jersey.api.client.Client client = com.sun.jersey.api.client.Client.create();
GetMarket result = client.resource(baseUrl + "/market/view/{context}")
.get(GetMarket.class);
//handle the result as needed...
Files
| name | size | description |
|---|---|---|
| agentrank-jersey-client.jar | 45.29K | The binaries for the Java client library. |
| agentrank-jersey-client-sources.jar | 36.41K | The sources for the Java client library. |
Java JSON Client Library
Created Apr 25, 2013 4:14:51 AM
Introduction
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.
REST Example (Raw Jackson)
java.net.URL url = new java.net.URL(baseURL + "/market/view/{context}");
ObjectMapper mapper = new ObjectMapper();
java.net.URLConnection connection = url.openConnection();
connection.connect();
GetMarket result = (GetMarket) mapper.readValue( connection.getInputStream(), GetMarket.class );
//handle the result as needed...
Files
| name | size | description |
|---|---|---|
| agentrank-json-client.jar | 38.03K | The binaries for the Java JSON client library. |
| agentrank-json-client-sources.jar | 34.92K | The sources for the Java JSON client library. |
Objective C Client Library
Created Apr 25, 2013 4:14:47 AM
Introduction
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.
REST XML Example
#import <agentrank.h>
//...
AGENTRANKNS0GetMarket *responseElement;
NSData *responseData; //data holding the XML from the response.
NSURL *baseURL = ...; //the base url including the host and subpath.
NSURL *url = [NSURL URLWithString: @"/market/view/{context}" 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];
AGENTRANKNS0GetMarket *responseElement = [AGENTRANKNS0GetMarket readFromXML: responseData];
[responseElement retain];
//handle the response as needed...
Files
| name | size | description |
|---|---|---|
| agentrank.h | 53.00K | |
| agentrank.m | 585.44K | |
| enunciate-common.h | 12.81K | Common header needed for all projects. |
| enunciate-common.m | 42.61K | Common implementation code needed for all projects. |