Retrieve work items from RTC using C# code
Accepted answer
If you're really "new", I suggest you learn how to use C# to access REST API first.
https://docs.microsoft.com/en-us/aspnet/web-api/overview/older-versions/build-restful-apis-with-aspnet-web-api
(Or whatever the tutorial you feel comfortable with)
Once you get familiar with it, plug the RTC REST API calls into your application. They are not that different from any other HTTP requests. The sequence of calls that you use for a particular task is the same for all programming languages I suppose, while handling the HTTP requests and responses is different.
Comments
Thanks Ralph and Donald:-)
string _serverURL = https://localhost:9443/ccm; string _resourceURL = "https://localhost:9443/ccm/rootservices";
_resourceURL + "/oslc/contexts/_0_iN4G09EeGGMqpyZT5XdQ/workitems/order"
CookieContainer _cookies = new CookieContainer();//create cookie container HttpWebRequest documentGet = (HttpWebRequest)WebRequest.Create(_resourceURL); documentGet.Method = "GET"; //method documentGet.CookieContainer = _cookies; //set container for HttpWebRequest documentGet.Accept = mediatype; documentGet.Headers.Set("OSLC-Core-Version", "3.0"); //for RTC 3.0.1.2 documentGet.Timeout = 300000; HttpWebResponse response = requestSecureDocument(documentGet, _serverURL, username, password);
Your _resourceURL variable contains an incorrect URL. Also, header "OSLC-Core-Version: 3.0" won't get you anywhere, as the current implemented OSLC version is 2.0.
One other answer
I am not a C# guy, but I know our developers for the VisualStudio integration use HTTPS/REST calls. This question has also come up several times already.
Comments
If you are new to this, you should better read the results of the google query.