Building the sample

In the following, it is assumed that Java SE 6 JDK is installed and available on the PATH.

To build the Java sample, open a command window and navigate to the src subfolder of the Java sample. The sample uses Apache Axis, which means the Axis class files must be available on the classpath.

First, we build the soapproxy package:

javac -classpath .:../build/lib/axis.jar:../build/lib/jaxrpc.jar

   com/enfocus/switchclientsdk/soapproxy/*.java

And then we can build the sample code:

javac -classpath .:../build/lib/axis.jar:../build/lib/jaxrpc.jar

   com/enfocus/switchclientsdk/sample/Main.java

On Windows it is necessary to use ‘;’ instead of ‘:’ in command prompt:

javac -classpath .;../build/lib/axis.jar;../build/lib/jaxrpc.jar

   com/enfocus/switchclientsdk/soapproxy/*.java

javac -classpath .;../build/lib/axis.jar;../build/lib/jaxrpc.jar

   com/enfocus/switchclientsdk/sample/Main.java

Now pack just built ‘.class’ files and manifest.txt  file, located in src directory, into jar archive:

jar cvfm SwitchClientSDK.jar manifest.txt

   com\enfocus\switchclientsdk\sample\*.class

   com\enfocus\switchclientsdk\soapproxy\*.class

Now the sample is ready to run, however, to create a connection with the Switch Server, we need SSL.  For this, a Java keystore (jks) file is needed.

This file can be generated from the cacert.pem root certificate (located in the Documentation/ssl subfolder of the SDK).  The JDK includes a keytool application that will create such a jks file:

keytool -import -trustcacerts -file ../../../Documentation/ssl/cacert.pem

-keystore cacert.jks -alias cacert

While generating cacert.jks the system asks the password. The correct password is 'password'.

After this, the sample is ready to run.