OSLC 400 bad request

Hello,
I would like to get my artifacts from one of my Requirements Management projects using OSLC. I can access the rootservices the catalog and the services.xml. When I try to get the queryBase or do a query on a specific artifact with its own id I get the following:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:err="http://jazz.net/xmlns/prod/jazz/foundation/1.0/"> <rdf:Description> <err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >java.lang.NullPointerException</err:detailedMessage> <err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >Bad Request</err:errorMessage> <err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long" >400</err:errorStatus> </rdf:Description> </rdf:RDF>
And a response with this message:
We're Sorry...
I have checked inside the Project Areas the configuration management should be enabled (This project area is now enabled for configurations.). The requirement was created by using the creation dialog from the services.xml.
The query I used for the single requirement:
queryBase + &oslc.prefix=dcterms=http://purl.org/dc/terms/&oslc.where=dcterms:identifier= ID
Thanks,
Ben
2 answers

I would consider to check the URL encoding. This is the query string I create for a valid query:
Comments

There are also some headers needed, e.g. OSLC-Core-Version: 2.0 and Accept: application/rdf+xml, and if configuration management is enabled you must provide the URI of the configuration as either an extra parameter &oslc_config.context=(encoded URI of the config) or header Configuration.context: (the URI of the config).

See here for an example of finding the configurations in a project https://jazz.net/forum/questions/266334/dng-oslcfetch-components-from-project-area/266667

Thanks for the answers, at first glance the ELM-Python-Client would do most of the things I would like. Unfortunately I get the same 400 Client Error.
Created two requirement projects one with configuration management and one without it. Tried both examples but neither of them works.
oslcquery -J https://my.server:port -U YOURUSERNAME -P YOURPASSWORD -p "My RM Project" -s dcterms:identifier,dcterms:title -O rmresults.csv
oslcquery -J https://my.server:port -U YOURUSERNAME -P YOURPASSWORD -p "My RM Project" -F "stream name" -s dcterms:title -O rmresults.csv
Requirement Creation Factory.
Will take a look at https://jazz.net/forum/questions/266334/dng-oslcfetch-components-from-project-area when have the time.
Comments


You could raise this as an issue in github https://github.com/IBM/ELM-Python-Client/issues


I think that the problems are caused by the version, currently running doors next gen 6.0.6.1 out of the box.
|
|
|
|
|
|

You're running 6.0.6.1 without any iFixes? You should update to the latest ifix 026. 6.0.6.1 is going out of support in September 2022 so you should plan to migrate to 7.0.2 iFix014.
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jul 05 '22, 11:12 a.m.Note the prefix like dcterms=http://purl.org/dc/terms/ isn't correct format because the URL should be surrounded with < and > like dcterms=<http://purl.org/dc/terms/>, and as Ralph says the whole value for prefix MUST be URL encoded (this is an http protocol requirement for building URLs, nothing to do with ELM). And see this article, (although it doesn't mention configurations) https://jazz.net/library/article/1197