我在集会中收到API密钥的身份验证错误。甚至api键也具有完全访问权限。
java.io.IOException: HTTP/1.1 401 Full authentication is required to access this resource
at com.rallydev.rest.client.HttpClient.executeRequest(HttpClient.java:163)
at com.rallydev.rest.client.HttpClient.doRequest(HttpClient.java:145)
at com.rallydev.rest.client.ApiKeyClient.doRequest(ApiKeyClient.java:37)
at com.rallydev.rest.client.HttpClient.doGet(HttpClient.java:221)
at com.rallydev.rest.RallyRestApi.query(RallyRestApi.java:168)
这是代码:
String wsapiVersion = "v2.0";
restApi.setWsapiVersion(wsapiVersion);
restApi.setApplicationName(projectname);
QueryRequest testCaseRequest = new QueryRequest("Testsets");
if(null !=workspace && ""!=workspace)
testCaseRequest.setWorkspace(workspace);
QueryResponse testCaseQueryResponse = restApi.query(testCaseRequest);
这是怎么了?
答案 0 :(得分:1)
我要检查的一件事是您是否在使用经过身份验证的代理服务器的公司网络内。除非您正确配置连接,否则代理甚至会在到达Rally之前拒绝您的请求。
我刚想到的第二件事是,是否在标题中设置了正确的字段以启用APIKey。我相信Rally服务器希望将ZSESSIONID设置为APIKey。