Using the .Net API

Added by Mads Hvelplund almost 2 years ago

I've been trying to write a simple Java library to emulate the Remote assembly from GitHub ( To do this, I looked at the XML going over the wire from the .Net version, and emulated that in Java. I got "force build" working and wanted to poll the server for the results of the build when I ran into problems. At first I thought it was my Java code (the usual suspect), but then I could see that the same problem seemed to exist with the .Net library.

My test code looks like this:

public void GetStatus() {
CruiseServerClient client = new CruiseServerClientFactory().GenerateClient("http://myserver/ccnet", "local")
as CruiseServerClient;
   String projectName = "MyProject";
   String buildName = client.GetMostRecentBuildNames(projectName, 1)[0];
   ProjectStatusSnapshot status = client.GetFinalBuildStatus(projectName, buildName);

When I debug it, I can se that the call to GetMostRecentBuildNames returns something like "log20151229103101Lbuild.47.xml". This looks like the name
used in the URL's for the Web front-end. However calling GetFinalBuildStatus returns null, and looking at the response XML, I can see that the response
contains a warning saying that the build name does not exist.

Am I missing something crucial, or is this part of the API simply broken?

Capture.PNG - Syntax highlighted screenshot (11.2 kB)