OSLC 400 bad request
Hello,
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
Can someone suggest me something?
Thanks, Ben
|
2 answers
Ralph Schoon (63.5k●3●36●46)
| answered Jul 05 '22, 10:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jul 05 '22, 10:06 a.m. 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
Ian Barnard
commented Jul 05 '22, 11:15 a.m.
| edited Jul 05 '22, 11:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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).
Ian Barnard
commented Jul 05 '22, 11:18 a.m.
| edited Jul 05 '22, 11:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.
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.
Comments
Ian Barnard
commented Jul 07 '22, 11:25 a.m.
| edited Jul 07 '22, 11:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Thanks for trying out my OSS! Note it's my personal project not an IBM codebase, and is not tested for production use, up to you to verify it meets your needs. You never did say what version+ifix you're using? Those commands work for me against 7.0.2 for bot an opt-in and an opt-out project
You could raise this as an issue in github https://github.com/IBM/ELM-Python-Client/issues
Ian Barnard
commented Jul 07 '22, 12:48 p.m.
| edited Jul 07 '22, 12:51 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You could also try the latest version 0.8: pip install -U elmclient although I've not consciously fixed a problem with a 400 error.
Ben Pal
commented Jul 11 '22, 10:30 a.m.
I think that the problems are caused by the version, currently running doors next gen 6.0.6.1 out of the box.
Ian Barnard
commented Jul 13 '22, 8:08 a.m.
| edited Jul 13 '22, 8:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I've run oslcquery against 6.0.6.1 GA without any real issues apart from for an opt-out project having to specify a component using -C and the same name as the project (this is fixed in latest 0.8.1).
Otherwise for a problem description as vague as "400 error" it's impossible to help - if you want any help with the 400 error please create an issue on https://github.com/IBM/ELM-Python-Client/issues oincluding as much detail as you get from the console trace and I'll try to help there (no guarantees!)
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. |
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.
Comments
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