1
我剛剛開始研究拉力賽API。我想創建一個新的測試用例結果,但我不斷收到一個異常,不知道爲什麼。我認爲這會變成一件非常愚蠢的事情,但我無法弄清楚。新的拉力賽API,試圖添加測試用例結果
繼承人我的代碼:
public static void updateRally(){
URL url
RallyService service = null
try{
url = new URL("https://rally1.rallydev.com/slm/webservice/1.36/RallyService")
service = (new RallyServiceServiceLocator()).getRallyService(url)
} catch (MalformedURLException e){
e.printStackTrace()
throw new Exception("RallyWebServiceClient.main problem in creating the url")
} catch (Exception e){
e.printStackTrace()
throw new Exception("RallyWebServiceClient.main problem in creating the service")
}
if (service == null){
println("Error: Service is null")
throw new Exception("RallyWebServiceClient.main service null...")
}
//Set authentication information on the service
Stub stub = (Stub)service
stub.setUsername("MyUsername")
stub.setPassword("MyPassword")
//Configure the service to maintain an HTTP session cookie
stub.setMaintainSession(true)
//Start calling methods on the service
User user = (User)service.getCurrentUser()
println(user.getDisplayName())
TestCase testCase = new TestCase()
testCase.setName("TC7571")
TestCaseResult result = new TestCaseResult()
result.setTestCase(testCase)
result.setBuild("1.16.0-SNAPSHOT-6256")
result.setDuration(1.0)
result.setTester(user)
result.setVerdict("Pass")
CreateResult createResult = service.create(result)
}
我一直斥罵那裏有在主線程與EXCIT代碼1.它沒有得到過去它讀取用戶的用戶=(用戶)service.getCurrentUser線路異常()
我按照我在拉力賽網站上找到的指南。我懷疑問題是我正在使用的URL。我也嘗試了WSDL的URL而不是上面的內容,並得到相同的問題。
我感謝任何幫助,謝謝。