Creating a ticket via POST using OSLC v2 using C# web api
![]()
Hi everyone,
I've got a little problem trying to create a new ticket in RTC. I'm using forms authentication using an implementation shown here: https://nkumar83.wordpress.com/2013/06/13/consuming-rtc-rational-team-concert-oslc-apis-using-c-post-1-authentication/ Up until now I've only had to use the GET and PUT methods for my calls to RTC, which have worked fine. I'm now trying to send a POST request to have a new ticket created. My code can successfully iterate the root services doc and work it's way through to find the creation factory URL for a ticket, in this case I'm working with unclassified tickets. The URL that my code has picked out is 100% the correct path as I've tested manually via Firefox using RESTClient. In fact, using the RESTClient I can create a ticket manually. I'm using the HttpWebRequest method in my code to build up a request for the RTC server. However when I make the call the RTC server is sending back a list of tickets. I can reproduce this behaviour manually if I set the RESTClient to use GET instead of POST against the creation factory URL. It's as though the RTC server for whatever reason wants to send data back for a GET request rather than process as a POST. I'm at a loss as to why this is happening. Project details: ASP.NET C# Web Api OSLC v2 Setting headers for accept and content type as: application/rdf+xml Any advice or pointers would be appreciated as I'm completely stuck. Thanks. |
One answer
![]()
Take a look at this article instead.
https://jazz.net/library/article/1001 If you are still having the problem, post the link of your POST operation, and the response header/body of the operation. Comments Hi Donald,
OSLC-Core-Version: 2.0 Response URI: https://{serverpath}:{port}/jazz/oslc/contexts/{valueobmitted}/workitems/TypeID.UnclassifiedTicket?oslc.pageSize=50&_resultToken={valueobmitted}&_startIndex=0 Method: GET Protocol version: 1.1 StatusCode: OK StatusDescription: OK The body is just a list of unclassified tickets which you can get by doing a GET operation against the requested URI in the original POST request. Just to confirm I removed/obmitted some of the values to remove any sensitive info. :o)
I re-read your original post and and realized that you had already done the verification on the POST URL and contents, so there should be no doubt on the RTC server side. I wonder whether it is an issue related to ASP.NET Web API, similar to this one?
|