It's all about the answers!

Ask a question

Unable to register Automation adapter on RQM 4.0.1 using OSLC REST API 2.0


pankaj mishra (1145) | asked Jul 12 '13, 5:48 a.m.
retagged Jul 22 '13, 4:39 p.m. by Ralph Earle (25739)
There is a document available for registering the adapter
https://jazz.net/wiki/bin/view/Main/RQMTestAutomationAdapterAPI

We have tried all the steps mentioned in the document. But when  we are trying to make the HTTP post  on the OSLC Automation adapter Creation URL  to register the adapter

https://foo.server:9443/qm/oslc_auto_test/contexts/_0I6VT9HVEeGSWYp6WoHgWA/resources/com.ibm.rqm.execution.ToolAdapter

RQM is giving :ERROR  HTTP 400 BAD REQUEST

The sample XML and headers used with HTTP Post request is as follows

Accept                       : Application/xml
Content-Type             : Application/rdf+xml
OSLC-Core-Version   : 2.0
X-Jazz-CSRF-Prevent :  Current Session id
 

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:rqm_qm="http://jazz.net/ns/qm/rqm#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:acp="http://jazz.net/ns/acp#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_qm="http://open-services.net/ns/qm#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:oslc_qm="http://open-services.net/ns/qm#"
xmlns:bp="http://open-services.net/ns/basicProfile#">
<oslc_qm:automationAdapter>
<rqm_qm:AutomationAdapter>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">ADAPTER</dcterms:title>
<dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Its a Adapter</dcterms:description>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">new</dcterms:identifier>
<dcterms:creator rdf:resource="https://foo.server:9443/jts/users/PANKAJ"/>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-07-08T09:29:35.726Z</dcterms:modified>
<dcterms:relation rdf:resource="https://foo.server:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_NEAak9pjEeKg1qPM_2Djjg/adapter/urn:com.ibm.rqm:adapter:6"/>
<oslc:serviceProvider rdf:resource="https://foo.server:9443/qm/oslc_auto_test/contexts/_NEAak9pjEeKg1qPM_2Djjg/services.xml"/>
<oslc:instanceShape rdf:resource="https://foo.server:9443/qm/oslc_auto_test/contexts/_NEAak9pjEeKg1qPM_2Djjg/shape/resource/com.ibm.rqm.execution.ToolAdapter"/>
<dcterms:type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">com.ibm.rqm.sample</dcterms:type>
<rqm_qm:pollingInterval rdf:datatype="http://www.w3.org/2001/XMLSchema#long">5</rqm_qm:pollingInterval>
<rqm_qm:hostname rdf:datatype="http://www.w3.org/2001/XMLSchema#string">host</rqm_qm:hostname>
<rqm_qm:fullyQualifiedDomainName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">host.company.co.in</rqm_qm:fullyQualifiedDomainName>
<rqm_qm:ipAddress rdf:datatype="http://www.w3.org/2001/XMLSchema#string">192.168.88.12</rqm_qm:ipAddress>
<rqm_qm:macAddress rdf:datatype="http://www.w3.org/2001/XMLSchema#string">eth4</rqm_qm:macAddress>
<rqm_qm:capability rdf:datatype="http://www.w3.org/2001/XMLSchema#string">IMPORT</rqm_qm:capability>
<rqm_qm:workAvailable rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</rqm_qm:workAvailable>
<rqm_qm:workAvailableUrl></rqm_qm:workAvailableUrl>
<rqm_qm:assignedWorkUrl></rqm_qm:assignedWorkUrl>
</rqm_qm:AutomationAdapter>
<oslc_qm:automationAdapter>
<rdf:RDF>


Any guidance would be appreciated ...............



2 answers



permanent link
Stephane Leroy (1.4k149) | answered Jul 16 '13, 8:57 a.m.
JAZZ DEVELOPER
Hi Pankaj,

I've not attempted to do what you're trying to achieve here but
.... obviously the XML content you're trying to post has some flaws:
For example, I see:
- <br="">: I'm unsure on how this is interpreted by the server. Possibly an error (to be checked...)
- a duplicated declaration of "oslc_qm" namespace... This  would typically be rejected by server (returned error message would be sthg like: "[org.xml.sax.SAXParseException: Attribute "oslc_qm" bound to namespace "http://www.w3.org/2000/xmlns/" was already specified for element...."")

These are few picks (as there might be additional errors).

From a more general perspective, to continue troubleshooting, you could:
- Use a tool like Poster, or a REST client
- Check CLM server status and response body messages and fix problems as appropriate

This blog post: http://sleroyblog.wordpress.com/2013/04/09/querying-rqm-40-through-oslc-and-rest-api   explains you how to feed the REST client with the adhoc the X-Jazz-CSRF-Prevent header+value.

Regards,
Stéphane

permanent link
pankaj mishra (1145) | answered Jul 24 '13, 2:30 a.m.
thank you..stephane .But we found the documentation provided at the link

https://foo.server:9443/qm/oslc_auto_test/contexts/_0I6VT9HVEeGSWYp6WoHgWA/resources/com.ibm.rqm.execution.ToolAdapter

has some bug/misinterpretation .When we use rqm_auto instead of rqm_qm  for registering the adapter ,it works fine 

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.