我正在嘗試使用Soap用戶界面和Rally在https://rally1.rallydev.com/slm/doc/webservice/公開的API添加測試案例。儘管如此,我可以用java代碼來做到這一點。由於每個頁面,我需要做一個POST/PUT來實現相同的,但我得到的錯誤使用Soap用戶界面添加測試案例Rally
{"CreateResult": {
"_rallyAPIMajor": "2",
"_rallyAPIMinor": "0",
"Errors": ["Not authorized to perform action: Invalid key"],
"Warnings": []
}}
我傳遞的有效載荷是如下
{
"Name": "Ignore:Newly added testcase associated to a Story3",
"Description": "Test creation of Story3",
"Owner": "https://rally1.rallydev.com/slm/webservice/v2.0/user/3215613515",
"Objective": "Test objective of Story3",
"PreConditions": "1. Hi<br>2. Hello",
"Project": "1223451",
"Notes": "Adding a test case"
}
請幫我解決這個問題。
添加樣品請求
POST https://rally1.rallydev.com/slm/webservice/v2.0/testcase/create?key=abc123 ..... HTTP/1.1 接受編碼:gzip,放氣 內容類型:應用/ JSON 的Content-Length:464 主機:rally1.rallydev用戶代理:Apache-HttpClient/4.1.1(java 1.5) Cookie:JSESSIONID = qs-app-07fv4cswgptt7b1vc3o58hztndw.qs-app-07; SERVERID = c1acc7f401011b9881d1497a9ef30b27acc4a1c9; __cfduid = d392a0428b5fa74f473cb1712c3d64d7a1483502577 COOKIE2:$版= 1
{
"testcase": {
"Name": "Ignore:Newly added testcase associated to a Story3",
"Description": "Test creation of Story3",
"Owner": "https://rally1.rallydev.com/slm/webservice/v2.0/user/28138408395",
"Objective": "Test objective of Story3",
"WorkProduct": "https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/61375703434",
"PreConditions": "1. Hi<br>2. Hello",
"Project": "/project/17133096258",
"Notes": "Adding a test case"
}`enter code here`
}
json是有效的,但可能拉力web服務正在等待不同的東西。你能檢查什麼是web服務等待哪個JSON哪個格式是拉力web服務等待的? – tremendows
以上錯誤消除了以下提到的「http://stackoverflow.com/questions/18620056/rally-json-io-error-creating-a-test-case-result」,但現在我得到了一個不同的錯誤 - 「錯誤」:[「未授權執行操作:無效密鑰」]。僅供參考,我嘗試了不同的令牌(新創建的密鑰)。 – Sizy
爲了使用POST創建對象,需要獲取安全密鑰;請參閱此處的webservices API文檔:https://rally1.rallydev.com/slm/doc/webservice/authentication.jsp。或者,您可能希望使用API密鑰代替基本身份驗證;請參閱https://www.ca.com/us/services-support/ca-support/ca-support-online/knowledge-base-articles.TEC01000001898.html – user4211235