The following are examples of each of the five core URL patterns outlined in Securing Server endpoints.
Corticon Admin SOAP example
In this example, the SOAP call is made to the /axis/services/CorticonAdmin URL requesting a list of Decision Services that are deployed on a remote server.
// Make the actual call to the Web Service String targetNamespaceXSD = "http://soap.corticon.com"; String returnValue = (String) call.invoke(targetNamespaceXSD, methodName, variables);
CorticonExecute SOAP example
In this example, the SOAP call is made to the /axis/services/CorticonExecute URL while passing a CorticonRequest String through a remote procedure call (RPC) to the remote server.
// Make the actual call to the Web Service String targetNamespaceXSD = "http://soap.corticon.com"; String returnValue = (String) call.invoke(targetNamespaceXSD, methodName, variables);
Corticon Decision Service Admin REST example
In this example, the REST API call is made to the /axis/corticon/decisionService/list URL requesting a list of Decision Services that are deployed on the remote server.
// Send the request; It will immediately return the response in HttpResponse object // if any CloseableHttpClient httpClient = HttpClients.createDefault(); HttpResponse response = httpClient.execute(getRequest);
// First verify for valid status code int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != 200) { String error = "Failed with HTTP error code " + statusCode + ": " + response.getFirstHeader("error");
In this example, the REST API call is made to the corticon/server/info URL requesting a JSONObject containing information about what Decision Services are currently deployed on the remote server.
// Send the request; It will immediately return the response in HttpResponse object // if any CloseableHttpClient httpClient = HttpClients.createDefault(); HttpResponse response = httpClient.execute(getRequest);
// First verify for valid status code int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != 200) { String error = "Failed with HTTP error code " + statusCode + ": " + response.getFirstHeader("error");
//Set the API media type in http content-type and the Decision Service Name to the header postRequest.addHeader("content-type", MediaType.APPLICATION_JSON); postRequest.addHeader(ICcServer.REST_HEADER_DECISION_SERVICE_NAME, "ProcessOrder");
JSONObject itemMetadata = new JSONObject(); itemMetadata.put("#id", "Item_id_1"); itemMetadata.put("#type", "Item");
item.put("__metadata", itemMetadata);
// Add Item object to rolename myItems order.put("myItems", item);
// Add Order to main payload JSONArray rootObjects = new JSONArray(); rootObjects.put(order); jsonPayload.put("Objects", rootObjects);
// Attach JSONObject to the postRequest jsonPayload.write(writer); StringEntity userEntity = new StringEntity(writer.getBuffer().toString(), "UTF-8"); postRequest.setEntity(userEntity);
// Send the request; It will immediately return the response in HttpResponse object // if any CloseableHttpClient httpClient = HttpClients.createDefault(); HttpResponse response = httpClient.execute(postRequest);
// First verify for valid status code int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != 200) { String error = "Failed with HTTP error code " + statusCode + ": " + response.getFirstHeader("error");