Clients

C Client Library

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<rsb.c>//... xmlTextReaderPtrreader=...;//set up the reader to the url.rsb_rest_data_resultsType*response_element=...;response_element=xml_read_rsb_rest_data_resultsType(reader);//handle the response as needed...//free the rsb_rest_data_resultsTypefree_rsb_rest_data_resultsType(response_element);

Java Client Library

Introduction

The Java client-side library is used to access the Web service API for this
application.

The Java client-side uses JAX-WS to access the
SOAP API for this application.

JAX-WS Example

// instantiate a new service with an impl// (or through dependency injection, or whatever)...MtomJobProcessorservice=newMtomJobProcessor();//make the remote call to read the result...result=service.process(job);//handle the result as needed...

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.URLurl=newjava.net.URL(baseURL+"/results/{applicationName}");JAXBContextcontext=JAXBContext.newInstance(Results.class);java.net.URLConnectionconnection=url.openConnection();connection.connect();Unmarshallerunmarshaller=context.createUnmarshaller();Resultsresult=(Results)unmarshaller.unmarshal(connection.getInputStream());//handle the result as needed...

REST Example (Jersey client)

com.sun.jersey.api.client.Clientclient=com.sun.jersey.api.client.Client.create();Resultsresult=client.resource(baseUrl+"/results/{applicationName}").get(Results.class);//handle the result as needed...

Java JSON Client Library

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.URLurl=newjava.net.URL(baseURL+"/results/{applicationName}");ObjectMappermapper=newObjectMapper();java.net.URLConnectionconnection=url.openConnection();connection.connect();Resultsresult=(Results)mapper.readValue(connection.getInputStream(),Results.class);//handle the result as needed...

Objective C Client Library

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.

PHP Client Library

Introduction

The PHP client-side library defines the PHP 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 requires the
json_encode function which
was included in PHP versions 5.2.0+.

Ruby Client Library

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").