RQM 5.0.2 Getting execution result attachements through REST API
![]()
I am using REST API for accessing RQM Test Plan details.
Now I need is to get Execution results through REST API. I am able to fetch the details , however it has some screen shots / Images which I am not able to download through my code. It needs browser to download it . Execution result link which through which I would be able to download the attachements / Images through my code. |
3 answers
![]()
Hi Harshal,
Can you try using the href value of the attachment tag coming as part of ExecutionResult xml Comments Yes I am using the href value
https://rtcclm2:9443/qm/service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/_k1F6wUzPEeWXOuHUUui6Mw However when I download this using M-Extras-RQMUrlUtil-4.0.3\RQMUrlUtility.jar -command GET -user ckumar45@in.ibm.c om -password 12345 -filepath C:\testplan\testplan.jpg -url "https://rtcclm2:94 43/qm/service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/ _g2unwUzPEeWXOuHUUui6Mw" It gives me corrupted file or Big file error |
![]()
I am using the same. the image which we get from it is corrupted or too big .
Below is the command I using M-Extras-RQMUrlUtil-4.0.3\RQMUrlUtility.jar -command GET -user ckumar45@in.ibm.c om -password 12345 -filepath C:\\testplan\\testplan.jpg -url "https://rtcclm2:94 43/qm/service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/ _g2unwUzPEeWXOuHUUui6Mw" Comments Have you tried with the version 5.0.2 of RQM URL Utility?
Yes , I tried same issue I am facing with 5.0.2 .
You don't have enough reputation to attach a screen shot here. Upload it somewhere else and link back here. Also, have you tried to open the file in a binary editor to see what the content looks like? You may be surprised to see what actually is in the file.
|
![]()
Harshal sent me the corrupted PNG file and I noticed that it was tagged with the UTF-8 BOM (the first six byes are EF BF BD 50 4E 47) while the first four bytes of a PNG file should be 89 50 4E 47. So it appears that the tool treats the stream as a string rather than binary. In fact, we can see the message "RQMUrlUtility: Calling [ HTTP GET ] method to retrieve XML from a specified URL" in the command output.
Strictly speaking, the IAttachmentRestService API is an internal API, not RQM Reportable REST API, so we can't expect it to work with any URLs. Since the source code is included in the tool, we can build the tool with some minor changes so that it can work with the internal attachment URL. 1. Locate the file RQMUrlUtility\src\com\ibm\rqm\url\client\RQMUrlGET.java. 2. Locate this line - it works for the "attachment" resource when using RQM Reportable REST API if (sAttachURL.indexOf("attachment") == -1) { 3. Change it as shown below - now it takes care of IAttachmentRestService API as well if (sAttachURL.indexOf("attachment") == -1 && sAttachURL.indexOf("IAttachmentRestService") == -1) { 4. Rebuild the tool. If the tool works correctly, we should see this message in the command output. RQMUrlUtility: Calling [ HTTP GET ] method to download an attachment |
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.