I have worked in SOAP message to get LoginToken from Webservice, and store the LoginToken in String and used System.out.println(LoginToken); to print. This prin
System.out.println(LoginToken);
I had a similar scenario, and I thought that something like
str.replaceAll("\[|\]", "");
looked cleaner. Of course, if your token might have brackets in it, that wouldn't work.