I was looking for a SSL Restful client to send xml messages to physical MDM. There is a post on IBM site, which shows how to use Apache Wink REST client API to make unsecured (HTTP) call. Here is the link where you can find the sample:
As my testing environment was secured (HTTPS), the call was failing. Here are few steps I did to send transaction over HTTPS.
1. Use InstallCert.java to get certificate from mdm server and add in local jre keystore. Compile the java file before running. The download package has a readme file. Read it before you proceed to get more information.
1.1. Go to your jre installation location (..\Java\jre1.8.0_121\lib\security). Run
java InstallCert mdmsrv:9043 (here mdmsrv is MDM secured server on WAS)
You will something similar when fetching certificate is done:
Added certificate to keystore ‘jssecacerts’ using alias ‘mdm114116-1’
1.2. keytool -exportcert -alias mdmsrv-1 -keystore jssecacerts -storepass changeit -file mdmsrv.cert (command to export certificate to mdmsrv.cert file)
1.3 keytool -importcert -alias mdmsrv -keystore cacerts -storepass changeit -file mdmsrv.cert (command to import certificate to jre keystore)
1.4 keytool -list -keystore cacerts (list all jre certificates. notice number of entries before and after adding certificate)
2. Use the client sample posted here:
[REST Web Services: Sample client code]
3. Add following jars to your REST client application class path:
You should see proper response from MDM. The key is to add certificate in your client jre (where you want to run the client).
Hope it will help.