2012-08-28 3 views
1

이제 막 랠리 API 작업을 시작했습니다. 새로운 테스트 케이스 결과를 만들고 싶지만 예외가 계속 발생하고 이유를 모르겠습니다. 나는 이것이 이것이 정말로 멍청한 무언가가 될 것이라고 생각하지만, 나는 그것을 이해할 수 없다. Heres는랠리 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을 시도해 보았습니다. 동일한 문제가 발생했습니다.

감사합니다. 감사합니다.

답변

2

우리는 새로운 사용자는 SOAP 대신에 우리의 REST API를 시도하는 것이 좋습니다 :

RallyRestApi restApi = new RallyRestApi(new URI("https://rally1.rallydev.com"), "[email protected]", "password"); 

JsonObject newTestCase = new JsonObject(); 
newTestCase.addProperty("Name", "Awesome Test"); 
CreateRequest createRequest = new CreateRequest("testcase", newTestCase); 
CreateResponse createResponse = restApi.create(createRequest); 

String newTestCaseRef = createResponse.getObject().get("_ref").getAsString(); 
:

http://developer.rallydev.com/help/java-toolkit-rally-rest-api

그런 다음 같은 것을 할 수 있어야한다

관련 문제