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...
The artifact, component or project cannot be found. It may have been deleted, archived or you may not have access to it. If the Project is enabled for Configuration Management, it may be that the Project is not visible in the given Configuration.
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
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
Can someone suggest me something?
Thanks,
Ben
Thanks,
Ben
2 answers
I would consider to check the URL encoding. This is the query string I create for a valid query:
For the identifier I have this in the query string: &oslc.where=dcterms%3Aidentifier%3D%22101%22 where the identifier is 101. Actually the ID is "101".
You could check Ians open souce project: https://github.com/IBM/ELM-Python-Client that might help with understanding the OSLC query mechanism.
Comments
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
The headers OSLC-Core-Version: 2.0 and Accept: application/rdf+xml are set. "I can access the rootservices the catalog and the services.xml." Also created a requirement with the
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
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jul 05 '22, 11:12 a.m.