But when I try to print token using command ‘response.getToken()’, it gives junk characters. (Real token appears in SOAP message).
Can you please advise why response.getToken() does print garbage chars and not token as appeared in SOAP message?
System.out.println("Token byte[]:"+ response.getToken()); // I tried with different CHARSET e.g.UTF-8etc.. but no luck.
Let me know if my questions are not clear enough.
Any help is appreciated.
Your question is really related to Java, not to the TRKD API as such.
If the response.getToken() method returns byte[] then you really cannot print like that. Try Arrays.toString() or DatatypeConverter.printHexBinary() before attempting to display.
Try this.byte[] bytes = authorizationtype.getToken();
String token = new BASE64Encoder().encode(bytes);