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

how to connect from c# to IBM RQM

How do i connect from c# to IBM RQM ?
When i used HP ALM i had some dlls which where registered on the client  machine, and then i would be using the c# using directive wih the name of the .dll
"using TDAPIOLELib;"
Ps: my plan is to use REST APIs ...to get :
-projects
-users
-testcases
-testscritps

and then to modify test script steps and upload it to the server...
I guess its possible but i am stuck at logging in ...

I digged in about OAuth but i couldnt find any code samples...

0 votes



5 answers

Permanent link
You can look at the authentication code of the RQM sample utilities (written in Java) that show the required requests for both basic and form authentication.  For example, see com.ibm.rqm.ct.client.internal.JFSHttpsClient.login(String, String) in the RQM Copy Utility (see https://jazz.net/wiki/bin/view/Main/RQMCopyUtility#Accessing_the_Source).

0 votes


Permanent link
I have found some source code :
http://blog.boriskuschel.com/2012/02/c-with-visual-studio-and-rational-team.html?showComment=1399373273027#c2233627067206926337

but unfortunately fails when trying to login
             if ((header != null) && header.Equals("authrequired"))
                {
                    documentResponse.GetResponseStream().Flush();
                    documentResponse.Close();
                    // The server requires an authentication: Create the login form

                    HttpWebRequest formPost = (HttpWebRequest)WebRequest.Create(serverURI + "/j_security_check");
                    formPost.Method = "POST";
                    formPost.Timeout = 30000;
                    formPost.CookieContainer = request.CookieContainer;
                    formPost.ContentType = "application/x-www-form-urlencoded";
                    String output = "j_username=" + login + "&j_password=" + password;
                    Byte[] outputBuffer = Encoding.UTF8.GetBytes(output);
                    formPost.ContentLength = outputBuffer.Length;
                    Stream stream = formPost.GetRequestStream();
                    stream.Write(outputBuffer, 0, outputBuffer.Length);
                    stream.Close();

                    // Step (2): The client submits the login form
                    if (DEBUG) Console.WriteLine(">> POST " + formPost.RequestUri);
                    HttpWebResponse formResponse = (HttpWebResponse)formPost.GetResponse();
}
The code throws an exception
:Error: The remote server returned an error: (408) Request Timeout.

I wonder whats wrong...

0 votes


Permanent link
Hi George,

have you checked this blog post already ? It gives you some C# authentication sample code - here in the context of querying RTC WIs.

http://nkumar83.wordpress.com/2013/06/13/consuming-rtc-rational-team-concert-oslc-apis-using-c-post-1-authentication/

Regards,
Stéphane

0 votes

Comments

The code is useless as expected...
I get the exception :
Error : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
on line:
var _serverResponse1 = _webClient.DownloadString(“https://localhost:9443/jazz/authenticated/identity”);


...??...


> 9443/jazz/

that is the old pre-3.0 context. isn't it

9443/jts/ now for authentication?

 i dont understand your question

George, what Sam suggested is that you may need to adapt the sample to your own case (e.g. the URL for accessing the Jazz server).

You must see those URLs in your browser already.  So should be easy to check/fix...

I tried changing the adresses and it didnt work ...obviously

Have you checked the URL by entering it in a web browser (e.g. should not be an HTTP 404 error...) ?

showing 5 of 6 show 1 more comments

Permanent link
I will try , but so far working with IBM technology is a nightmare -_-...
I guess IBM never heard about c#...only Java crap...-_-''

0 votes


Permanent link

I completely agree with you george claud. I would never consider myself moving to IBM technology. Everything is in JAVA :(

We are also planning to move to IBM RTC. I could not find any samples to access RQM. Is your code working now? Could you share me the working sample, would be great helpful for me?

I am doing PoC. It's very urgent.Could you help me?

Thanks in Advance!

0 votes

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

Question asked: May 05 '14, 2:06 p.m.

Question was seen: 7,016 times

Last updated: Mar 14 '16, 12:19 a.m.

Confirmation Cancel Confirm