Files and Libraries
The following files and libraries are available:
- License
- C Client Library
- .NET Client Library
- Java Client Library
- Java JSON Client Library
- Objective C Client Library
- PHP Client Library
- Ruby Client Library
License
Created Nov 16, 2015 2:23:26 PM
The license file governing the use of this API.
Files
name | size |
---|---|
LICENSE.txt | 11.00bytes |
C Client Library
Created May 3, 2016 9:16:26 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 <VAR Interface Control Document.c>
//...
xmlTextWriterPtr writer = ...; //set up the writer to the url.
VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage *request_element = ...;
xmlTextReaderPtr reader = ...; //set up the reader to the url.
VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage *response_element = ...;
//set up the VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage...
xml_write_VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage(writer, request_element);
response_element = xml_read_VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage(reader);
//handle the response as needed...
//free the VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage
free_VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage(request_element);
//free the VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage
free_VAR_Interface_Control_Document_ns0_VARAppointmentRequestMessage(response_element);
Files
name | size | description |
---|---|---|
VAR Interface Control Document.c | 2.27M | |
enunciate-common.c | 39.67K | Common code needed for all projects. |
.NET Client Library
Created May 3, 2016 9:16:31 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( VARAppointmentRequestMessage )
);
//Create the request object
WebRequest req = WebRequest.Create(uri);
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
TextReader r = new StreamReader( stream );
VARAppointmentRequestMessage order = (VARAppointmentRequestMessage) s.Deserialize( r );
//handle the result as needed...
This bundle contains C# source code.
Files
name | size |
---|---|
VAR Interface Control Document-dotnet.zip | 12.23K |
Java Client Library
Created May 3, 2016 9:16:31 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 + "/appointment-service/patient/{assigning-authority}/{patient-id}/appointment-requests/system/{system-id}/id/{appointment-request-id}/messages");
JAXBContext context = JAXBContext.newInstance( VARAppointmentRequestMessage.class, VARAppointmentRequestMessage.class );
java.net.URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.connect();
Unmarshaller unmarshaller = context.createUnmarshaller();
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(vARAppointmentRequestMessage, connection.getOutputStream());
VARAppointmentRequestMessage result = (VARAppointmentRequestMessage) 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();
VARAppointmentRequestMessage result = client.resource(baseUrl + "/appointment-service/patient/{assigning-authority}/{patient-id}/appointment-requests/system/{system-id}/id/{appointment-request-id}/messages")
.entity(vARAppointmentRequestMessage)
.post(VARAppointmentRequestMessage.class);
//handle the result as needed...
Files
name | size | description |
---|---|---|
VAR Interface Control Document-client.jar | 80.61K | The binaries for the Java client library. |
VAR Interface Control Document-client-sources.jar | 55.28K | The sources for the Java client library. |
Java JSON Client Library
Created May 3, 2016 9:16:31 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 + "/appointment-service/patient/{assigning-authority}/{patient-id}/appointment-requests/system/{system-id}/id/{appointment-request-id}/messages");
ObjectMapper mapper = new ObjectMapper();
java.net.URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.connect();
mapper.writeValue(connection.getOutputStream(), vARAppointmentRequestMessage);
VARAppointmentRequestMessage result = (VARAppointmentRequestMessage) mapper.readValue( connection.getInputStream(), VARAppointmentRequestMessage.class );
//handle the result as needed...
Files
name | size | description |
---|---|---|
VAR Interface Control Document-json-client.jar | 67.53K | The binaries for the Java JSON client library. |
VAR Interface Control Document-json-client-sources.jar | 52.06K | The sources for the Java JSON client library. |
Objective C Client Library
Created May 3, 2016 9:16:26 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 <VAR Interface Control Document.h>
//...
VAR_INTERFACE_CONTROL_DOCUMENTNS0VARAppointmentRequestMessage *requestElement = [[VAR_INTERFACE_CONTROL_DOCUMENTNS0VARAppointmentRequestMessage alloc] init];
NSData *requestData; //data holding the XML for the request.
VAR_INTERFACE_CONTROL_DOCUMENTNS0VARAppointmentRequestMessage *responseElement;
NSData *responseData; //data holding the XML from the response.
NSURL *baseURL = ...; //the base url including the host and subpath.
NSURL *url = [NSURL URLWithString: @"/appointment-service/patient/{assigning-authority}/{patient-id}/appointment-requests/system/{system-id}/id/{appointment-request-id}/messages" relativeToURL: baseURL];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
NSURLResponse *response = nil;
NSError *error = NULL;
[request setHTTPMethod: @"POST"];
[request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
//set up the VAR_INTERFACE_CONTROL_DOCUMENTNS0VARAppointmentRequestMessage...
requestData = [requestElement writeToXML];
[request setHTTPBody: requestData];
//this example uses a synchronous request,
//but you'll probably want to use an asynchronous call
responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
VAR_INTERFACE_CONTROL_DOCUMENTNS0VARAppointmentRequestMessage *responseElement = [VAR_INTERFACE_CONTROL_DOCUMENTNS0VARAppointmentRequestMessage readFromXML: responseData];
[responseElement retain];
//handle the response as needed...
Files
name | size | description |
---|---|---|
VAR Interface Control Document.h | 99.59K | |
VAR Interface Control Document.m | 1.22M | |
enunciate-common.h | 12.82K | Common header needed for all projects. |
enunciate-common.m | 42.34K | Common implementation code needed for all projects. |
PHP Client Library
Created May 3, 2016 9:16:27 AM
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+.
Files
name | size |
---|---|
VAR Interface Control Document.php | 248.30K |
Ruby Client Library
Created May 3, 2016 9:16:27 AM
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").
This library leverages the Ruby JSON Implementation, which is required in order to use this library.
JSON REST Example
require 'net/https'
require 'uri'
//...
//read a resource from a REST url
url = URI.parse("...")
request = Net::HTTP::Post.new(url.request_uri)
input = VARAppointmentRequestMessage.new
//set up the VARAppointmentRequestMessage...
request.body = input.to_json
request['Content-Type'] = "application/json"
http = Net::HTTP.new(url.host, url.port)
//set up additional http stuff...
res = http.start do |ht|
ht.request(request)
end
result = VARAppointmentRequestMessage.from_json(JSON.parse(res.body))
//handle the result as needed...
Files
name | size |
---|---|
VAR Interface Control Document.rb | 132.04K |