It's all about the answers!

Ask a question

reqif_oslc definitions GET request fails


Manoj Kumar (132) | asked Jun 08 '21, 1:54 a.m.

I am trying GET request for reqIF oslc definitons but we are getting 400 BAD Request error. Below is the request i I am sending,



We are getting a Bad request error as,


I would like to know what is wrong in the request or what should be the correct value. The error occurs specially when the last part of the request i.e., 'oslc.where' is added. removing the 'oslc.where' fetches the rdf file for me. I am using 7.0.2 server and 6.0.6.1 client(tried with 6.0.6.1 server and 6.0.6.1 client also) from my eclipse application. Is the request url format is wrong?

Also, is there any API documentation for reqif_oslc(+defintions)? Please direct.

I am using JKE banking project.


Comments
Ian Barnard commented Jun 08 '21, 12:10 p.m. | edited Jun 08 '21, 12:41 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Ah you're trying to query reqif definitions - see my answer below.

And yes whatever query you make you'll have to encode the URL properly.

Accepted answer


permanent link
Ian Barnard (1.9k613) | answered Jun 08 '21, 12:40 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jun 09 '21, 3:04 a.m.

You're trying to do a query of reqif definitions, or if you're not then you haven't picked the correct QueryCapability.


Assuming you are, as well as properly URL encoding the URL you put to the server, you should note what the reqif API wiki page says about the query capability for reqif definitions; basically it isn't a full OSLC Query and can only handle limited parameters, specifically not oslc:select, oslc:searchTerms or oslc:orderBy, and only dcterms:title and dcterms:modified can be in the oslc.where term.

You'll need to provide a header oslc_config.context or Configuration-Context - not sure this is needed for query but it is certainly needed for export/import.


5.5 Behaviour of GET (query)

A GET to the dng_reqif:ReqIFQueryCapability will retrieve all existing dng_reqif:ReqIFDefinition resources in the component.

The dng_reqif:ReqIFQueryCapability uri can be obtained from the OSLC Service provider document

The response to a GET to the dng_reqif:ReqIFDefinition resource uri will be a 200 in case the retrieval was successful.

The returned data is an OSLC response format which include zero, one or many dng_reqif:ReqIFDefinition resources

An OSLC user can modify the behavior of the default query capability by using the oslc_where parameter

Filter on following fields are supported

  • dcterms:title : Exact match, case sensitive.
  • dcterms:modified: Equals, greater than, less than.

Following OSLC parameters are not supported by the ReqIF Query capability

  • oslc.select
  • oslc.searchTerms.
  • oslc.orderBy.

I found this technote which might be useful, although it's about Export it references the headers needed https://www.ibm.com/support/pages/exporting-reqif-file-containing-requirements-using-rest-api

Manoj Kumar selected this answer as the correct answer

One other answer



permanent link
David Honey (1.8k17) | answered Jun 08 '21, 4:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jun 08 '21, 4:28 a.m.

In your example, the request parameter values are not being fully URL encoded.

For example, it looks like you're trying to specify an OSLC query expression nav:parent=<https://<machine_name>:<port>/rm/process/project-areas/_di640JfPEeuJi7IajZiqzw> .
This should be encoded as nav%3Aparent%3D%3Chttps%3A%2F%2F%3Cmachine_name%3E%3A%3Cport%3E%2Frm%2Fprocess%2Fproject-areas%2F_di640JfPEeuJi7IajZiqzw%3E.
The same applies to the other parameter values. I don't know if this is the cause of the 400 Bad Request response, but I'd fix that first.

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.