RQM 5.0.2 Getting execution result attachements through REST API
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
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
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 .
This is the command execution
C:\Users\IBM_ADMIN\Downloads\RQM-Extras-RQMUrlUtil-5.0.2>java.exe -jar C:\Users\
IBM_ADMIN\Downloads\RQM-Extras-RQMUrlUtil-5.0.2\RQMUrlUtility.jar -command GET -
user ckumar45@in.ibm.com -password 12345 -filepath C:\RQM_Attachment.png -url "
https://rtcclm2:9443/qm/service/com.ibm.rqm.planning.service.internal.rest.IAtta
chmentRestService/_g2unwUzPEeWXOuHUUui6Mw"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<----- [ RQMUrlUtility ] ---->>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Default cookie policy RFC_2109 is used.
RQMUrlUtility: Connected to https://rtcclm2:9443 using project "cclm2:9443"
Attempting to create SSL_TLS context
java.security.NoSuchAlgorithmException: SSL_TLS SSLContext not available
Unable to create SSL_TLS context, trying SSLv3
RQMUrlUtility: Calling [ HTTP GET ] method to retrieve XML from a specified URL
RQMUrlUtility: Server Response code: 200
RQMUrlUtility: [ SUCCESS ] XML string retrieved from URL : "https://rtcclm2:9443
/qm/service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/_g
2unwUzPEeWXOuHUUui6Mw " is written to file located at -: " C:\RQM_Attachment.pn
g "
Disconnecting from the IBM Rational Quality Manager server.
This is what I am getting when I open the file
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.
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
which is this in this case
|
|
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