Issues with constructing an oslc.where URL and valid XML results
I'm currently working on a set of C# services and applications that require a certain degree of integration with our Rational Team Concert implementation. Specifically, I've been asked to present a list of Change Requests to which the currently logged in user subscribes so that they may add the URLs for these Change Requests with certain items in another application. I am attempting to obtain this list via a query in the style of https://<rtchost>:9443/ccm/oslc/contexts/_Tf1GwI4UEeGDLvoSNiZKIA/workitems?oslc.where=dc:identifier="5535" or something similar. However, no matter how I build the URL, I get a list in XML of ALL Change Requests in the system. In addition, the XML in the result set contains no information about the namespaces, which makes parsing the results more difficult. The XML just starts with a <oslc_cm:Collection> tag and proceeds from there.
I'm sure the list is long, but what am I doing wrong here?
Accepted answer
Comments
Hi Jim,
Sadly, the alteration of the where clause continues to produce the same results. The issue isn't even related to dc:identifier or any specific prefix, but all prefixes or attempts at filtering. I've attempted virtually filtering on virtually all prefixes I can identify in the XML by visual inspection, with nary a variation in result.
The returned XML still contains no namespace specifications in the results, but I've found my way around that with some post processing on my own. My biggest issue is the attempt, via an oslc.where clause, to return, in XML, a list of all Change Requests to which a given user subscribes. While that is clearly more complicated than what I provided in my example, it was meant to demonstrate the issues I'm experiencing while attempting to use that oslc.where clause for even simple filtering.
Thanks!
2 other answers
Comments
Jim,
The issue isn't just restricted to the dc prefix, which is defined in the oslc_cm:Collection root node for the result set. Literally any attempted use of the oslc.where clause in the URL returns the same set of results, regardless of parameter or identifier.
Thanks!
Comments
I think that oslc_cm:Collection is from OSLC 1.0 and in that version you need to use oslc_cm.query=dc:identifier=... to filter results. See http://open-services.net/bin/view/Main/CmQuerySyntaxV1#Query_Syntax
Fernando,
Changing the Accept header did produce something different. Unfortunately, it's an Error 406 from the server. However, I still consider this a step in the right direction, as it tells me something is coming back that I just can't seem to process correctly. I'm still investigation the URL change you suggested.
Thanks!
Normally, I only got the 406 error when I forget to include the accept header. Could you share the code that create the url and execute the GET request?
Comments
Donald Nong
Oct 01 '15, 2:31 a.m.Which version of RTC are you using? In my test, if the OSLC property is incorrectly defined, RTC will complain about it. I have never seen that RTC will ignore the oslc.where filter (well except for the partial representation).
James Waslo
Oct 01 '15, 9:16 a.m.Donald,
The server under target is running RTC 5.0.2, from what I understand. I'm not actually part of the RTC Development Team, just trying to consume some of its data. I'm equally puzzled by this behavior myself, but remain convinced I'm doing something wrong rather than RTC.
Thanks!