The SSC Client Library for Java
An optimized client library for the Java (TM) platform is included with SunSystems as part of any SunSystems Connect installation. It provides a client side interface to the SSC web services for the Java programming language. This library requires that the consuming Java application is compiled and running with a minimum of Java version 11. See https://openjdk.java.net/projects/jdk/11/ for details.
Client Library Classes
The client library provides proxy classes for accessing the web services described previously. These are:
com.systemsunion.ssc.client.ComponentExecutor
com.systemsunion.ssc.client.SecurityProvider
com.systemsunion.ssc.client.LicensingProvider
com.systemsunion.ssc.client.LocatorServiceProvider
These classes implement a one-to-one mapping of methods and parameters with their corresponding web service methods. There is one important exception to this.
ComponentExecutor.Execute
The client implementation of the ComponentExecutor service provides an alternative implementation of the Execute method with the following signature:
void StreamExecute(
String authentication,
String licensing,
String component,
String method,
String group,
Reader payload,
Writer response
)
This method allows the input payload and the response payload to be streamed to/from the SunSystems Connect server. This allows very large payloads to be handled with a minimal impact on the memory requirements of the overall system.
A side effect of streaming the payloads is that the server starts executing the payload before it has received a complete SOAP packet. It is not advisable to use this method where the payload and/or network integrity cannot be guaranteed.
The default method is also provided. For example:
String Execute(
String authentication,
String licensing,
String component,
String method,
String group,
String payload
)
Including the Client Library
The Java client library is provided as a single Java Archive (JAR) file for easy inclusion within another application. This library has a dependency upon the Apache Log4j2 framework, a version of which is also provided alongside the client library for convenience. All of the required files can be obtained from:
<SunSystems Installation
Folder>\SSC\connect-client\java\
All three files must be included to any application to use the classes and methods provided. For example:
java -cp
"yourapp.jar;C:\Program Files\Infor\SunSystems\SSC\connect-client\java\*"
com.yourcompany.yourapp.ApplicationEntryPoint
The client library JAR files must be copied for inclusion within any custom application code.
It is convenient to use the installed versions while upgrading SunSystems but no guarantee can be made regarding file locking and stability of your application if you are relying upon the deployed files directly.
Java code example
After the connect-client.jar and the log4j2 dependency JARs have been included on the new application class path it will be possible to access services from the SSC application.
This sample Java Class shows how to call a "Query" method on the "Employee" component using the SSC SOAP API:
import com.systemsunion.security.IAuthenticationVoucher;
import com.systemsunion.ssc.client.SecureSoapComponent;
import com.systemsunion.ssc.client.SecurityProvider;
import com.systemsunion.ssc.client.SoapComponent;
public class SSCExample {
public static void main(final String[] args) throws Exception {
String sscServerName = "servername.infor.com";
boolean useEncryption = true;
String username = "PK1";
String password = "";
// obtain a SunSystems Security Voucher via SecurityProvider SOAP API
SecurityProvider securityProvider = new SecurityProvider(sscServerName, useEncryption);
IAuthenticationVoucher voucher = securityProvider.Authenticate(username, password);
// setup and authenticate a SOAP API component proxy
SoapComponent component = null;
if (useEncryption) {
component = new SecureSoapComponent(sscServerName);
} else {
component = new SoapComponent(sscServerName);
}
component.authenticate(voucher);
// call 'Query' method via SOAP API ...
String inputPayload = "<SSC>" +
" <User>" +
" <Name>" + username + "</Name>" +
" </User>" +
" <SunSystemsContext>" +
" <BusinessUnit>PK1</BusinessUnit>" +
" </SunSystemsContext>" +
" <Payload>" +
" </Payload>" +
"</SSC>";
String strOut = component.execute("Employee", "Query", inputPayload);
System.out.println(strOut);
}
}