It's all about the answers!

Ask a question

How to fetch the RTC project area linked to a RQM project area in a LPA using OSLC?

Achla Sharma (31316) | asked May 20 '15, 8:24 a.m.
edited May 20 '15, 8:25 a.m.
We are building a utility that creates a test case in RQM programatically and links it to a workitem(representing requirement) in RTC. For this, we are required to fetch the information of the associated RTC project area.On performing a GET on the catalog URI, I am recieving the following xml response:

<oslc:ServiceProvider ns12:type="oslc:ServiceProvider" rdf:about="">
                <oslc:details rdf:resource=""/>
                <jproc:consumerRegistry rdf:resource=""/>

The jproc:consumerRegistry tag specifies the links URL for all the associated project areas.

On performing a GET to the URL, following is the response received:
    <jp:link jp:projectArea="">
        <oslc:ServiceProvider xmlns:oslc="">
            <dc:title xmlns:dc="">Child_60</dc:title>
            <oslc:details xmlns:rdf="" rdf:resource=""/>
            <oslc:services xmlns:rdf="" rdf:resource=""/>
            <jp:consumerRegistry xmlns:rdf="" rdf:resource=""/>

I am using the xpath ://jp:link[jp:link-type="tracked-by"]/oslc:ServiceProvider/oslc:services/@rdf:resource to fetch the services.xml for the linked project area. I am receiving a null value for it.

Is this the proper way for fetching associations? Some help would be appreciated

One answer

permanent link
Jim Amsden (29337) | answered May 21 '15, 2:04 p.m.
Although it is possible to use HTTP directly and use XPath to parse RDF/XML to find the information you need, that would not be the recommended approach. The reason is that your implementation can be difficult to develop, and sensitive to a particular variant of RDF/XML (of which there are many valid variants).

Instead you may want to explore more abstract APIs such as Eclipse Lyo that hides all these details and does the HTTP protocol negotiations and request and response processing for you. There's a tutorial on Integrating Products with OSLC on that you may find very helpful. This tutorial walks through the OSLC discovery capabilities and provides a good explanation for how to navigate the discovery documents and services to get the information you need.

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.