Rally-rest-api v2.21 updateCollection 无法工作

Rally-rest-api v2.21 updateCollection can not work

我想通过 rally-rest-api v2.21 批量添加一些缺陷,但是遇到如下错误:

原因:java.io.IOException:HTTP/1.1 405 无法使用请求方法 �POST¼ 找到 �/project/xxxxx/remove.js¼ 的 Web 服务。但是,使用方法 �GET¼.

在该路径上确实存在服务

请帮帮我,谢谢。

我的代码片段:

Gson gson = new Gson();
JsonParser jsonParser = new JsonParser();
JsonArray defItem = new JsonArray();
for (DefectBean defect : defects)
{
  defItem.add(jsonParser.parse(gson.toJson(defect)));
}
CollectionUpdateRequest defectTCollectionAddRequest = new CollectionUpdateRequest(collectionRef, defItem, true);
CollectionUpdateResponse defectTagCollectionAddResponse = restApi.updateCollection(defectTCollectionAddRequest); 

你的 collectionRef 是什么?您的缺陷物品是什么样的? updateCollection 方法适用于集合中的 adding/removing 项,如此处所述:

https://rally1.rallydev.com/slm/doc/webservice/rest_collections.jsp