Files and Libraries

The following files and libraries are available:

C Client Library

Created Jan 11, 2013 4:05:50 PM

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 <full.c> //... xmlTextReaderPtr reader = ...; //set up the reader to the url. full_ns0_scmState *response_element = ...; response_element = xml_read_full_ns0_scmState(reader); //handle the response as needed... //free the full_ns0_scmState free_full_ns0_scmState(response_element);

Files

name size description
full.c 387.43K
enunciate-common.c 39.70K Common code needed for all projects.

.NET Client Library

Created Jan 11, 2013 4:05:54 PM

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( ScmState ) ); //Create the request object WebRequest req = WebRequest.Create(uri); WebResponse resp = req.GetResponse(); Stream stream = resp.GetResponseStream(); TextReader r = new StreamReader( stream ); ScmState order = (ScmState) s.Deserialize( r ); //handle the result as needed...

This bundle contains C# source code.

Files

name size
full-dotnet.zip 3.70K

Java Client Library

Created Jan 11, 2013 4:05:54 PM

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 + "/authentication/login"); JAXBContext context = JAXBContext.newInstance( ScmState.class ); java.net.URLConnection connection = url.openConnection(); connection.connect(); Unmarshaller unmarshaller = context.createUnmarshaller(); ScmState result = (ScmState) 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(); ScmState result = client.resource(baseUrl + "/authentication/login") .post(ScmState.class); //handle the result as needed...

Files

name size description
full-client.jar 22.54K The binaries for the Java client library.
full-client-sources.jar 13.36K The sources for the Java client library.

Java JSON Client Library

Created Jan 11, 2013 4:05:54 PM

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 + "/authentication/login"); ObjectMapper mapper = new ObjectMapper(); java.net.URLConnection connection = url.openConnection(); connection.connect(); ScmState result = (ScmState) mapper.readValue( connection.getInputStream(), ScmState.class ); //handle the result as needed...

Files

name size description
full-json-client.jar 18.09K The binaries for the Java JSON client library.
full-json-client-sources.jar 12.83K The sources for the Java JSON client library.

Objective C Client Library

Created Jan 11, 2013 4:05:51 PM

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 <full.h> //... FULLNS0ScmState *responseElement; NSData *responseData; //data holding the XML from the response. NSURL *baseURL = ...; //the base url including the host and subpath. NSURL *url = [NSURL URLWithString: @"/authentication/login" 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]; FULLNS0ScmState *responseElement = [FULLNS0ScmState readFromXML: responseData]; [responseElement retain]; //handle the response as needed...

Files

name size description
full.h 21.89K
full.m 288.77K
enunciate-common.h 12.81K Common header needed for all projects.
enunciate-common.m 42.61K Common implementation code needed for all projects.