Introduction
The following items are available for download:
C Client Library
Created 05-Oct-2012 09:31:01.
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 <nexus-licensing-plugin.c>
//...
xmlTextReaderPtr reader = ...; //set up the reader to the url.
nexus_licensing_plugin_ns0_accessContentResponseDTO *response_element = ...;
response_element = xml_read_nexus_licensing_plugin_ns0_accessContentResponseDTO(reader);
//handle the response as needed...
//free the nexus_licensing_plugin_ns0_accessContentResponseDTO
free_nexus_licensing_plugin_ns0_accessContentResponseDTO(response_element);
file | size |
---|---|
nexus-licensing-plugin.c | 108.07K |
.NET Client Library
Created 05-Oct-2012 09:31:02 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( AccessContentResponseDTO )
);
//Create the request object
WebRequest req = WebRequest.Create(uri);
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
TextReader r = new StreamReader( stream );
AccessContentResponseDTO order = (AccessContentResponseDTO) s.Deserialize( r );
//handle the result as needed...
This bundle contains C# source code.
file | size |
---|---|
nexus-licensing-plugin-dotnet.zip | 1.19K |
JAX-WS Client Library (Java 5+)
Created 05-Oct-2012 09:31:02 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 + "/csv_access_data");
JAXBContext context = JAXBContext.newInstance( AccessContentResponseDTO.class );
java.net.URLConnection connection = url.openConnection();
connection.connect();
Unmarshaller unmarshaller = context.createUnmarshaller();
AccessContentResponseDTO result = (AccessContentResponseDTO) 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();
AccessContentResponseDTO result = client.resource(baseUrl + "/csv_access_data")
.get(AccessContentResponseDTO.class);
//handle the result as needed...
Files
file | size | description |
---|---|---|
nexus-licensing-plugin-client.jar | 4.98K | The binaries for the JAX-WS client library. |
nexus-licensing-plugin-client-sources.jar | 2.69K | The sources for the JAX-WS client library. |
Objective C Client Library
Created 05-Oct-2012 09:31:01.
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 <nexus-licensing-plugin.h>
//...
NEXUS_LICENSING_PLUGINNS0AccessContentResponseDTO *responseElement;
NSData *responseData; //data holding the XML from the response.
NSURL *baseURL = ...; //the base url including the host and subpath.
NSURL *url = [NSURL URLWithString: @"/csv_access_data" 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];
NEXUS_LICENSING_PLUGINNS0AccessContentResponseDTO *responseElement = [NEXUS_LICENSING_PLUGINNS0AccessContentResponseDTO readFromXML: responseData];
[responseElement retain];
//handle the response as needed...
Files
file | size | description |
---|---|---|
nexus-licensing-plugin.h | 7.34K | |
nexus-licensing-plugin.m | 91.68K |