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...
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...
5 answers
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).
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...
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...
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
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
Comments
showing 5 of 6
show 1 more comments
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!