Introduction
The following items are available for download:
License
Created May 13, 2009 10:02:51 AM.
The license file governing the use of this API.
| file | size |
|---|---|
| LICENSE.txt | 4.96K |
RealAnswers API Executive Summary
Created Sep 15, 2009 6:09:56 AM.
A guide to features provided by the RealAnswers API.
| file | size |
|---|---|
| RealAnswers_API_Executive_Summary.pdf | 113.40K |
RealAnswers API Integration Guide
Created Sep 4, 2009 7:24:43 AM.
A guide to integrating the RealAnswers API into a website.
| file | size |
|---|---|
| RealAnswers_API_Integration_Guide.pdf | 86.27K |
C Client Library
Created Mar 21, 2010 5:55:28 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 <realtybaron.c>
//...
xmlTextReaderPtr reader = ...; //set up the reader to the url.
realtybaron_ns0_getAnswers *response_element = ...;
response_element = xml_read_realtybaron_ns0_getAnswers(reader);
//handle the response as needed...
//free the realtybaron_ns0_getAnswers
free_realtybaron_ns0_getAnswers(response_element);
| file | size |
|---|---|
| realtybaron.c | 636.71K |
.NET Client Library
Created Mar 21, 2010 5:55:39 AM for .NET 2.0.
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( GetAnswers )
);
//Create the request object
WebRequest req = WebRequest.Create(uri);
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
TextReader r = new StreamReader( stream );
GetAnswers order = (GetAnswers) s.Deserialize( r );
//handle the result as needed...
This bundle contains C# source code.
| file | size |
|---|---|
| realtybaron-dotnet.zip | 6.17K |
JAX-WS Client Library (Java 5+)
Created Mar 21, 2010 5:55:40 AM for Java (Version 5+).
Introduction
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 + "/answers/get/{id}");
JAXBContext context = JAXBContext.newInstance( GetAnswers.class );
java.net.URLConnection connection = url.openConnection();
connection.connect();
Unmarshaller unmarshaller = context.createUnmarshaller();
GetAnswers result = (GetAnswers) 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();
GetAnswers result = client.resource(baseUrl + "/answers/get/{id}")
.get(GetAnswers.class);
//handle the result as needed...
Files
| file | size | description |
|---|---|---|
| enunciate-client.jar | 35.62K | The binaries for the JAX-WS client library. |
| enunciate-client-sources.jar | 25.59K | The sources for the JAX-WS client library. |
Objective C Client Library
Created Mar 21, 2010 5:55:31 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
#include <realtybaron.h>
//...
REALTYBARONNS0GetAnswers *responseElement;
NSData *responseData; //data holding the XML from the response.
NSURL *baseURL = ...; //the base url including the host and subpath.
NSURL *url = [NSURL URLWithString: @"/answers/get/{id}" 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];
REALTYBARONNS0GetAnswers *responseElement = [REALTYBARONNS0GetAnswers readFromXML: responseData];
[responseElement retain];
//handle the response as needed...
Files
| file | size | description |
|---|---|---|
| realtybaron.h | 43.44K | |
| realtybaron.m | 505.62K |
Ruby Client Library
Created Mar 21, 2010 5:55:31 AM for Ruby.
Introduction
The Ruby 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.
JSON REST 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 = GetAnswers.from_json(JSON.parse(res.body))
//handle the result as needed...
| file | size |
|---|---|
| realtybaron.rb | 57.64K |