c# login to IBM CLM exception
george claud (12●8●11)
| asked May 06 '14, 7:30 a.m.
edited May 07 '14, 3:16 p.m. by Paul Slauenwhite (8.4k●1●2)
I try to login to IBM CLM server using some c# code from
http://blog.boriskuschel.com/2012/02/c-with-visual-studio-and-rational-team.html?showComment=1399373273027#c2233627067206926337 I am stuck at the part where the code throws an exception at the last instruction: 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(); .. } Error: The remote server returned an error: (408) Request Timeout. I wonder whats wrong ... Best regards Can you please help ? |
2 answers
Sreerupa Sen (1.0k●4)
| answered May 08 '14, 12:50 p.m.
FORUM MODERATOR / JAZZ DEVELOPER edited May 08 '14, 12:51 p.m.
Have you checked out https://jazz.net/library/article/601#How_VSClient_Fails_Login_Proxy_One? We've attached source code for a console application that logs into the Jazz server.
Cheers
--Rupa
Comments
george claud
commented May 09 '14, 6:45 a.m.
Hi,
george claud
commented May 09 '14, 7:02 a.m.
I have modified to
|
The HTTP code 408 is quite tricky to troubleshoot. In the case of Jazz server form based authentication, it could be that Tomcat behaves unexpectedly to the /j_security_check request. Many people met the same or similar problem before. regardless what programming languages or scripts they used. You can search "j_security_check" on jazz.net to see how others failed or succeeded
|
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.