I am using Maximo 126.96.36.199 REST API and want to write REST client in java to consume this RESTful service. I have enabled Maximo security in Maximo 7.5 side to keep the Maximo users to access its own REST services. The below is my Java code to consume above same RESTful service. I am getting 401 error and though I am giving credentials as property, it is not authorizing it. Please see the attached code(ClientCode.jpg).
Please check the output in "ConsoleResponse.jpg".
Note: I am successfully able to query the same Maximo REST service using the Chrome's Postman plugin. Below 2 are my Postman's (REST client) Headers. 1. MAXAUTH - bWF4YWRtaW46bWF4YWRtaW4= 2. Accept - Application/xml
Though I have given the authorization (MAXAUTH) in headers, I used to get the pop-up window to enter username and password to query Maximo REST service. Once I give the credentials, I get the response (Response.jpg).
Please help me to consume the Maximo RESTful service (when native Authentication enabled) using Java code.
Thanks in Advance.