stack72 / TeamCitySharp

No Longer Maintained - please use https://github.com/mavezeau/TeamCitySharp
Other
200 stars 165 forks source link

Projects.Create() throws HttpException: BadRequest #70

Closed asbjornu closed 10 years ago

asbjornu commented 10 years ago

When trying to use TeamCityClient.Projects.Create(String) against our TeamCity v7.1.5 (build 24400) installation, it fails with the following exception:

EasyHttp.Infrastructure.HttpException : BadRequest Error: Bad Request
HTTP: BadRequest
URL: http://tc.example/httpAuth/app/rest/projects/
Error has occurred during request processing (Bad Request).
Error: javax.ws.rs.WebApplicationException: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: Content is not allowed in prolog.], caused by: javax.xml.bind.UnmarshalException, caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
Not supported request. Please check URL, HTTP method and transfered data are correct. 

The code provoking this exception is as follows:

var client = new TeamCityClient("tc.example");
client.Connect("Username", "Password");
var project = client.Projects.Create("Test");

Any idea what the problem might be?