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

Server stopps responding after PUT request

 I am trying to update some test case data programmatically via PUT request. On the first request, everything works fine. After that, the next PUT request just times out, the RQM server seems to stop responding to any requests, also GET or POST requests fail with timeout.


Is this a known issue, or should i do some kind of logout after a PUT request or something similar? If I wait a while and login-logout to RQM interactively a couple of times, it works again, but again only once.

0 votes


Accepted answer

Permanent link

 Somehow I had commented out my "response.close()" during login. So for the server I was initiating a session again and again, so the sessions were locking out each other.


Now I'm taking extra care to really close the requests and all is working fine...

Ralph Schoon selected this answer as the correct answer

0 votes


3 other answers

Permanent link

 There is pretty much no usable information in this post. See How should I ask a question in the Forum if I want to receive useful answers?


Since the Web UI uses PUT all the time, I would assume it is your client and its usage that creates the lock up. Since you omitted providing any insight in how the PUT is done, I'd suggest you search in a forum related to your method doing the PUT. 

If, after your PUT, communication with the server is no longer possible using a Browser, your PUT kills the server which should not happen. The server log could be a place to start.

0 votes


Permanent link

As Ralph mentioned, it's difficult to provide assistance with no details (including the REST API you are using).  I would suggest it's your HTTP client since this is not an expected behaviour.

0 votes

Comments

It could be something basic as a missing consumeContent() on the Apchae httpClient instance. 


Permanent link

 Thanks for the answers, I'll try to be more specific:


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...

0 votes

Comments

I am not a RQM API expert, however:

  • The API you use does not seem to be a supported API. 
  • I would have expected an OSLC API. An OSLC header is missing.
  • "/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/" is not an URI I would consider to find in the OSLC discovery documents or service providers

 Hi Ralph, 

Thanks again... I thought OSLC and REST were supported? 
Anyway, as usual the problem was on the other side of the keyboard (see my own answer below).

I will look into this, maybe it's better to use the OSLC approach if classical REST is really not supported. 


OSLC is supported but "/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/" does not look like an OSLC URI and OSLC would require an OSLC header as well.


So you are NOT using an OSLC API as far as I can tell. Probably an internal API. Not totally sure though. 

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,951
× 480

Question asked: Jan 17 '19, 3:32 a.m.

Question was seen: 2,587 times

Last updated: Jan 17 '19, 9:16 a.m.

Confirmation Cancel Confirm