What I am trying to do is update the description of many test cases in RQM programmatically. So I GET the test case, do some minor changes in the XML I received from the GET request and PUT back the whole XML to RQM.
I am trying to connect via c# programmatically to our companies RQM server. My c# application does an authentication somthing like this:
request2 = (HttpWebRequest)WebRequest.Create(_rqmSrvr + "/jts/authenticated/j_security_check?j_username="+ username + "&j_password="+ password);
Then I get a response with the authentication cookie and store that for later use. This works fine. The next thing I do in my code is a GET request, something like:
XDocument testcase = RQMGetRequest(_rqm_srvr+"/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources//testcase/urn:com.ibm.rqm:testcase:4964")
The method uses the cookie internally and puts it in the CookieContainer of the GET request.
This also works fine.
I then modify the description of the test case, and send it back with something like:
RQMPutRequest(_rqm_srvr+"/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources//testcase/urn:com.ibm.rqm:testcase:4964", myModifiedXml)
Where I also provide the cookie container internally in that method.
The PUT method internally looks like this:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(prefix + querySuffix);
request.CookieContainer = _rqmSessionCookieContainer;
request.Method = "PUT";
request.Accept = "application/xml";
request.ContentType = "text/xml; encoding='utf-8'";
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(xdoc.ToString());
request.ContentLength = bytes.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
requestStream.Dispose();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
I am just trying out things at the moment, so I do the whole procedure every time new:
- Login to the server
- Get the cookie
- Do the GET request for a single (sample) test case
- Do the PUT request
First time: all ok, second dime: Timeout
Maybe there is there some kind of disposal of the session that I should do, before starting the second time?
I have no access (or I don't know how to access) the RQM server logs, unfortunately...
Thanks for the advice again, I hope this makes a bit clearer what I want to do...