HTTP Service is the most lightweight and unrestricted remote service: it supports POST and GET requests to a predefined URL. The result is retrieved as is and rendered as a webpage.


Example 1

This example shows how to call through an HTTP web service. In this case, the pKa values of a molecule are calculated.


An example calculation with this web service can be found below.


Example 2

This example shows how to reach the functionalities of through HTTP API.

HTTPServiceDescriptor descriptor = new HTTPServiceDescriptor();
descriptor.addArgument(ServiceArgument.createArgument("mol", ""));
descriptor.addArgument(ServiceArgument.createArgument("special", ""));
descriptor.addArgument(ServiceArgument.createArgument("pka_width", 0));
Object result = null;
try {
result = descriptor.getServiceHandler().callService(descriptor, "c1ccnccc1", "pka", 300);
} catch (ServiceException e) {
System.err.println("Service call failed.");
System.out.println("Synchronized call returned: " + String.valueOf(result));
descriptor.getServiceHandler().callService(descriptor, new AsyncCallback<String>() {
public void onSuccess(String result) {
System.out.println("Aynchronous call returned: " + result);
public void onFailure(ServiceException caught) {
System.err.println("Asynchronous call failed.");
}, "c1ccnccc1", "pka", 300);