It's all about the answers!

Ask a question

need help creating a testcase in RQM using RESTAPI


Vinod Reddy (1326) | asked Aug 03 '12, 4:53 p.m.
edited Aug 06 '12, 10:24 a.m.
Hi - i am trying to create a testcase using a RESTAPI
i have build the following  readtest.xml XML, see below

then, ran the command as:
java -jar c:\Keydata\Omnifind\ICA\QA\RQM\RQMUrlUtility.jar -command POST -user vreddy@us.ibm.com -password xxxxxxx -filepath c:\Keydata\Omnifind\ICA\QA\RQM\readtest.xml -url https://hostname:9450/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Discovery/testcase

But it fails with following error:

RQMUrlUtility: Connected to https://svljazz06.svl.ibm.com:9450 using project "Discovery"
Aug 3, 2012 4:47:18 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling [ HTTP POST ] method to upload ATTACHMENT to Attachment Feed
RQMUrlUtility: Server Response code: 415
i cannot from anywhere what the response code 415 means!

note: i read through another post similar to this topic but the suggestions from that post did not help.
Appreciate your expert help here!

<?xml version="1.0" encoding="UTF-8"?><testcase xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns2="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns4="http://purl.org/dc/elements/1.1/" xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1"><ns4:title>VINODXXXTEST</ns4:title><ns4:description>VINODXXXTEST</ns4:description><weight>100</weight><category term="Test Type" value="Integration Test"/><variables/><template href="https://svljazz06.svl.ibm.com:9450/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Discovery/template/testcase/com.ibm.rqm.planning.templates.testcase.template_1294327799046"/></testcase>

3 answers



permanent link
Hao Wan (1.5k35) | answered Aug 16 '12, 5:33 a.m.
JAZZ DEVELOPER
Hi Vinod,
as you are using UrlUtility, you need to change the POST request to PUT and append a testcase id,
you can use the following url
java -jar c:\Keydata\Omnifind\ICA\QA\RQM\RQMUrlUtility.jar -command PUT -user vreddy@us.ibm.com -password xxxxxxx -filepath c:\Keydata\Omnifind\ICA\QA\RQM\readtest.xml -url https://hostname:9450/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Discovery/testcase/a1

because for UrlUtility, POST is only for attachment artifact
please refer to
Artifact upload --:
-command PUT -user ADMIN -password ADMIN -filepath C:\\RQMUrlUtility_PUT.txt
-url https://localhost:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality%20Manager/testsuite/tsuite_n1

Attachment upload --:
-command POST -user ADMIN -password ADMIN -filepath C:\\RQM_Attachment.jpg
-url https://localhost:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality%20Manager/attachment/attach_n2

from https://jazz.net/wiki/bin/view/Main/RqmApi#RQM_URL_Utility

Comments
Vinod Reddy commented Aug 16 '12, 4:03 p.m.

thanks! that worked!


permanent link
Hao Wan (1.5k35) | answered Aug 16 '12, 5:35 a.m.
JAZZ DEVELOPER
what's more if you want to use POST request to create testcase, you can use poster https://jazz.net/wiki/bin/view/Main/RQMUsingPoster

permanent link
Pramod Chandoria (2.1k11220) | answered Aug 04 '12, 11:26 a.m.
JAZZ DEVELOPER
Hi Vinod,
414 response means "Unsupported media type"
Not sure why are you seeing this message when actually testcase is being uploaded
RQMUrlUtility: Calling [ HTTP POST ] method to upload ATTACHMENT to Attachment Feed
You can send me email with your xml file and also would like to remove the name of server (IP) in this post

Comments
Vinod Reddy commented Aug 06 '12, 10:22 a.m.

HI Pramod - thanks for your response. am sending the xml file in email, i dont find an option here to attach a file.


Vinod Reddy commented Aug 06 '12, 10:24 a.m.

also the reponse code am getting is 415, not 414. Thanks!

Your answer


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