Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



One answer

Permanent link
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.

0 votes

Comments

Hi Donald,

Thanks for replying.  Here is the info you requested, hopefully it will shed some light?



Header content for POST request:

     Content-Type: application/rdf+xml
     Accept: application/rdf+xml
     OSLC-Core-Version: 2.0
     Host: {hosthere}:{porthere}
     Cookie: JSESSIONID={valuehere}; JazzFormAuth=Form; JSESSIONIDSSO={valuehere}

Method: POST
Protocol version: 1.1

Request URI: https://{serverpath}:{portvalue}/jazz/oslc/contexts/{valueobmitted}/workitems/TypeID.UnclassifiedTicket}

UserAgent: null

==================

Response headers:

OSLC-Core-Version: 2.0
Vary: Accept, OSLC-Core-Version
Transfer-Encoding: chunked
Cache-Control: private, max-age=0, must-revalidate
Content-Type: application/rdf+xml;charset=UTF-8
Date: Mon, 31 Aug 2015 09:49:48 GMT
Expires: Mon, 31 Aug 2015 09:49:48 GMT
ETag: "{valueremoved}"
Server: Apache-Coyote/1.1

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?
http://stackoverflow.com/questions/10984040/post-parameter-is-always-null

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 516
× 16

Question asked: Aug 30 '15, 12:27 p.m.

Question was seen: 5,079 times

Last updated: Sep 03 '15, 8:52 p.m.

Related questions
Confirmation Cancel Confirm