It's all about the answers!

Ask a question

load new category values into RQM using REST


yair shaked (13197) | asked Mar 05 '13, 5:52 a.m.
edited Mar 05 '13, 8:11 a.m. by Paul Slauenwhite (8.4k12)
 We followed the documentation in 
https://jazz.net/wiki/bin/vilew/Main/RQMURLUtility
https://jazz.net/wiki/bin/view/Main/RqmApi#Troubleshooting

We used FireFox ResetClient to invstigate an existing category in order to create an input XML file as specified here:
https://jazz.net/wiki/bin/view/Main/RqmApi#Generated_ID

We identified the XML presentation of a category using this url:
https://129.35.209.200:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/JKE+Banking+%28Quality+Management%29/category
In order to insert a new category to an active RQM project, we created an XML 


We send the following command:
java -jar RQMUrlUtility.jar -command POST -user clmadmin -password XXXXX -context qm -filepath /home/maroshi/Downloads/RQM-Extras-RQMUrlUtil-4.0.1/categoryPostRequest.xml -url https://129.35.209.200:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/JKE+Banking+%28Quality+Management%29/category/cat1

cat1 is the category type

Our categoryPostRequest.xml context is:

    <?xml version="1.0" encoding="UTF-8"?>
    <ns2:category 
xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/" 
xmlns:ns1="http://schema.ibm.com/vega/2008/" 
xmlns:ns3="http://purl.org/dc/elements/1.1/" 
xmlns:ns4="http://jazz.net/xmlns/prod/jazz/process/0.6/" 
xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" 
xmlns:ns6="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:ns7="http://purl.org/dc/terms/" 
xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" 
xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" 
xmlns:ns10="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" 
xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" 
xmlns:ns12="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" 
xmlns:ns13="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" 
xmlns:ns14="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" 
xmlns:ns16="http://jazz.net/xmlns/alm/qm/styleinfo/v0.1/" 
xmlns:ns17="http://www.w3.org/1999/XSL/Transform">
    <ns2:projectArea alias="JKE+Banking+%28Quality+Management%29" href="https://129.35.209.200:9443/qm/resource/itemOid/com.ibm.team.process.ProjectArea/_yQlosEESEeKJfvaUoytc5g"/>
    <ns3:title>cat1.3</ns3:title>
    <ns2:categoryType href="https://129.35.209.200:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/JKE+Banking+%28Quality+Management%29/categoryType/urn:com.ibm.rqm:categoryType:_bA3ngoVzEeK5xerYymXkYA"/>
    </ns2:category>

We fail with response 401, we do not know how to further investigate and get better diagnostic response.
1. Please advise what is the correct  request URI
2. Please advise what is the content of the correct categoryPostRequest.xml

Accepted answer


permanent link
Paul Slauenwhite (8.4k12) | answered Mar 05 '13, 8:44 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
It's hard to determine the root cause without the QM log.  One thing to check would be if the category type exists. 

Note, a POST request should not contain an external ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#id).
yair shaked selected this answer as the correct answer

Comments
yair shaked commented Mar 05 '13, 10:35 a.m.

2013-03-05 10:28:35,841 [             WebContainer : 14]  INFO com.ibm.rqm.planning                                - Failed to parse XML for PUT request https://129.35.209.200:9

443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/JKE+Banking+%28Quality+Management%29/category/slug__WK9Y8IWpEeK5xerYymXkYA
javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.]


Paul Slauenwhite commented Mar 05 '13, 12:25 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Looks like categoryPostRequest.xml did not contain the XML prolog.  If it did, please remove it.

One other answer



permanent link
Paul Slauenwhite (8.4k12) | answered Mar 05 '13, 8:16 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Your request/XML looks good.  The problem is the 401 (Unauthorized) response code suggesting your user does not have sufficient privileges to create categories.

Comments
yair shaked commented Mar 05 '13, 8:23 a.m.

 i'm sorry the error is 400 , bad request  and not 400 , (typo error)


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.