I am getting com.ibm.watson.developer_cloud.service.exception.UnauthorizedException: Unauthorized: Access is denied due to invalid credentials error while i am using the right credentials. I am doing like this..
service = new VisualRecognition(VisualRecognition.VERSION_DATE_2015_12_02);
File image = new File("src/test/resources/visual_recognition/car.png");
VisualClassification result = service.classify(image).execute();
Where on Bluemix the Visual Recognition credentials are like this
Please help me to solve the issue. Thanks in advance!
This may be an error in your question, rather than an error in your code, however please double check that you pass to setUsernameAndPassword method the parameters in the correct order (username, password) as specified in the API Reference. Looking at your code I see
that is (password, username). I've just tried using the correct order and it works fine for me.