Files and Libraries

The following files and libraries are available:

Executive Summary

Created Jan 13, 2011 3:03:53 AM

A guide to features provided by the RealAnswers API.

Files

name size
Executive_Summary.pdf 125.93K

Integration Guide

Created Feb 8, 2010 9:36:00 AM

A guide to integrating the RealAnswers API into a website.

Files

name size
Integration_Guide.pdf 86.27K

License

Created Feb 8, 2010 9:36:01 AM

The license file governing the use of this API.

Files

name size
LICENSE.txt 4.96K

C Client Library

Created Jan 20, 2012 3:42:27 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_postQuestion *response_element = ...; response_element = xml_read_realtybaron_ns0_postQuestion(reader); //handle the response as needed... //free the realtybaron_ns0_postQuestion free_realtybaron_ns0_postQuestion(response_element);

Files

name size description
realtybaron.c 862.44K
enunciate-common.c 38.69K Common code needed for all projects.

.NET Client Library

Created Jan 20, 2012 3:42:33 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( PostQuestion ) ); //Create the request object WebRequest req = WebRequest.Create(uri); WebResponse resp = req.GetResponse(); Stream stream = resp.GetResponseStream(); TextReader r = new StreamReader( stream ); PostQuestion order = (PostQuestion) s.Deserialize( r ); //handle the result as needed...

This bundle contains C# source code.

Files

name size
realtybaron-dotnet.zip 9.81K

Java Client Library

Created Jan 20, 2012 3:42:33 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 + "/question/post/{context}"); JAXBContext context = JAXBContext.newInstance( PostQuestion.class ); java.net.URLConnection connection = url.openConnection(); connection.connect(); Unmarshaller unmarshaller = context.createUnmarshaller(); PostQuestion result = (PostQuestion) 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(); PostQuestion result = client.resource(baseUrl + "/question/post/{context}") .post(PostQuestion.class); //handle the result as needed...

Files

name size description
realtybaron-answers-jersey-client.jar 49.02K The binaries for the Java client library.
realtybaron-answers-jersey-client-sources.jar 35.36K The sources for the Java client library.

Java JSON Client Library

Created Jan 20, 2012 3:42:33 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 + "/question/post/{context}"); ObjectMapper mapper = new ObjectMapper(); java.net.URLConnection connection = url.openConnection(); connection.connect(); PostQuestion result = (PostQuestion) mapper.readValue( connection.getInputStream(), PostQuestion.class ); //handle the result as needed...

Files

name size description
realtybaron-answers-json-client.jar 40.56K The binaries for the Java JSON client library.
realtybaron-answers-json-client-sources.jar 33.70K The sources for the Java JSON client library.

Objective C Client Library

Created Jan 20, 2012 3:42:29 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 <realtybaron.h> //... REALTYBARONNS0PostQuestion *responseElement; NSData *responseData; //data holding the XML from the response. NSURL *baseURL = ...; //the base url including the host and subpath. NSURL *url = [NSURL URLWithString: @"/question/post/{context}" relativeToURL: baseURL]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url]; NSURLResponse *response = nil; NSError *error = NULL; [request setHTTPMethod: @"POST"]; //this example uses a synchronous request, //but you'll probably want to use an asynchronous call responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; REALTYBARONNS0PostQuestion *responseElement = [REALTYBARONNS0PostQuestion readFromXML: responseData]; [responseElement retain]; //handle the response as needed...

Files

name size description
realtybaron.h 61.24K
realtybaron.m 624.17K
enunciate-common.h 12.22K Common header needed for all projects.
enunciate-common.m 41.77K Common implementation code needed for all projects.