To compile and run the Java HPCBP Client please follow these instructions. NOTE: if your JAVA_HOME location contains spaces or the directory path of the HPC SDK contains spaces you may need to alter some of these commands. For instance, you may need to use double quotes ("" - e.g. set JAVA_HOME=""C:\Program Files\Java\"") when you set the environment variables or place the unexpanded command in quotes (" - e.g. "%JAVA_HOME%\bin\javac"). The schema compilation in stage 7 will not work if the Schemas parent directory has a space in it. If this is the case copy the Schema directory to a file location that has n o space in it and re-run the command providing an absolute file path.

1. Open a command window and change into the Samples\HPCBPServiceV2\JavaHPCBP directory

2. Download a binary version of Axis2 1.4 package and unzip the file and set AXIS2_HOME to the installed location.

3. Download a binary version of Rampart 1.3 package and unzip the file

4. Copy the files *.mar from .\rampart-1.3 to the .\modules directory

5. Download a binary version of Ant and unzip the file

6. Set JAVA_HOME to your local Java installation which must be a full JDK (not just a JRE).
   
7. Generate the Java stubs for the web service

.\axis2-1.4\bin\wsdl2java -s -or -uri ..\Schemas\bes-factory.wsdl

8. Compile the Java HPCBP Client

.\apache-ant-1.7.0\bin\ant.bat -f build-client.xml compile.src

9. Obtain the CA certificate for the HPCBP web service installation you are going to use in *.cer format

Note: The Active Directory certificate generally used to identify the HPCBP web service does not appear to be acceptable
to the Java security library. To create a self signed certificate under Windows as an Administrator user run:

makecert.exe -r -pe -n "CN=<FULLY QUALIFIED HOST NAME>" -b 07/01/2008 -e 07/01/2009 -eku 1.3.6.1.5.5.7.3.1 -ss my -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12

This will generate a self-signed certificate. You will need to configure the HPCBP web service to use this certificate to identify itself - this can be done using the hpcbpws.ps1 PowerShell script. From the Microsoft Management Console (MMC) export the public part of this certificate and install this file into the Java environment (see next step).

If the certificate does not appear as an option when running the hpcbpws.ps1 script then use IIS and the MMC to create the certificate and move it into the correct certficate store.

10. Create a Java Keystore to hold the certificate

"%JAVA_HOME%\bin\keytool" -importcert -alias HPCBP-CA -trustcacerts -file myca.cer -keystore castore -storepass trustnoone

11. In the build-client.xml and conf\axis2.xml replace the YOURUSERNAME entries with your username on the remote HCPBP system.

12. In the build-client.xml replace the YOURPASSWORD entry with your password on the remote HPCBP system.

13. In the build-client.xml replace the YOURENDPOINT entry with the URL to the remote HPCBP system, e.g. https://hostname.org/HPCBasicProfile

14. Run the Java HPCBP Client

.\apache-ant-1.7.0\bin\ant.bat -f build-client.xml run.client

You should see the job run for about 10s and then finish. Check the user console for details.

To run different jobs change the name of the HPCBP.xml 
in the build-client.xml file with another HPCBP-* file from the ..\HPCBP
Client directory.

