Introduction
The following items are available for download:
License
Created Jul 24, 2012 8:22:49 PM.
The license file governing the use of this API.
file | size |
---|---|
LICENSE.txt | 40.00bytes |
C Client Library
Created Feb 25, 2014 8:41: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 <legatoppm.c>
//...
xmlTextReaderPtr reader = ...; //set up the reader to the url.
legatoppm_session_session *response_element = ...;
response_element = xml_read_legatoppm_session_session(reader);
//handle the response as needed...
//free the legatoppm_session_session
free_legatoppm_session_session(response_element);
file | size |
---|---|
legatoppm.c | 645.18K |
.NET Client Library
Created Feb 25, 2014 8:41:36 AM for .NET 2.0.
Introduction
The .NET client-side library may be used to access the SOAP API for this application via the .NET runtime.
.NET Service Example
//instantiate a new service...
LegatoCustomCategoryService service = new LegatoCustomCategoryService();
//make the remote call...
result = service.GetCustomCategory(categoryId);
//handle the result as needed...
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( Session )
);
//Create the request object
WebRequest req = WebRequest.Create(uri);
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
TextReader r = new StreamReader( stream );
Session order = (Session) s.Deserialize( r );
//handle the result as needed...
This bundle contains C# source code.
file | size |
---|---|
legatoppm-dotnet.zip | 13.17K |
JAX-WS Client Library (Java 5+)
Created Feb 25, 2014 8:41:37 AM for Java (Version 5+).
Introduction
The JAX-WS client-side library may be used to access the SOAP API for this application via the Java runtime, using JAX-WS. This is a slim, light, client library with minimal dependency bloat (as of Java 6, JAX-WS ships with the JDK), but it requires Java 5+.
JAX-WS Example
// instantiate a new service with an impl
// (or through dependency injection, or whatever)...
LegatoCustomCategoryService service = new LegatoCustomCategoryService();
//make the remote call to read the result...
result = service.getCustomCategory(categoryId);
//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.URL url = new java.net.URL(baseURL + "/connect/{userName}/{password}");
JAXBContext context = JAXBContext.newInstance( Session.class );
java.net.URLConnection connection = url.openConnection();
connection.connect();
Unmarshaller unmarshaller = context.createUnmarshaller();
Session result = (Session) 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();
Session result = client.resource(baseUrl + "/connect/{userName}/{password}")
.get(Session.class);
//handle the result as needed...
Files
file | size | description |
---|---|---|
legatoppm-client.jar | 226.38K | The binaries for the JAX-WS client library. |
legatoppm-client-sources.jar | 150.75K | The sources for the JAX-WS client library. |
Objective C Client Library
Created Feb 25, 2014 8:41:30 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 <legatoppm.h>
//...
LEGATOPPMSESSIONSession *responseElement;
NSData *responseData; //data holding the XML from the response.
NSURL *baseURL = ...; //the base url including the host and subpath.
NSURL *url = [NSURL URLWithString: @"/connect/{userName}/{password}" 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];
LEGATOPPMSESSIONSession *responseElement = [LEGATOPPMSESSIONSession readFromXML: responseData];
[responseElement retain];
//handle the response as needed...
Files
file | size | description |
---|---|---|
legatoppm.h | 50.95K | |
legatoppm.m | 480.07K |