Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to make a post request to Requirements Management DOORS Next Gen with OSLC

 I'm getting an error when trying to make a most to RM DOORS Next, Version 7.0.2 with OSLC API. The error I'm getting is ">com.ibm.rdm.fronting.server.exception.MethodNotAllowedException



I'm wondering if there is additional paramters required for 7.0.2? 

Thanks

0 votes

Comments

 If you think the readers of your question will compose the request and then answer, think twice. Provide the URI, the headers, the content of the post you did etc.


The article is 10 years old, configuration management is something that is new in DNG since then and related information might (or might not) be needed.

To use the OSLC APIs you'll need to specify a configuration (using parameter oslc_config.context or header Configuration.Context) and always provide headers OSLC-Core-Version: 2.0, for post/put provide Content-Type: application/rdf+xml, for get provide Accept: application/rdf+xml.


If that doesn't fix things then provide all the details (with hostnames obfuscated) of the URL (with encoded parameter values), body and headers, and the response details (body and headers) Also the iFix you're using. If you're doing this programatically now I suggest you revert to a REST client in a logged in browser and get that to work (because it reduces the possibilities for multiple mistakes), then code to replicate the successful manual POST.

Thanks for your response Ian. For the "Configuration-Context" what exsctly is the url there? just jazz.com/rm? 

The URI of a configuration.



One answer

Permanent link

 Heres' my approach: 

 

Type: POST
URL: https://<jazz_doman>:<port>/rm/requirementFactory?projectURL=https://<jazz_domain>:<port>/rm/process/project-areas/<rm_project_id>
BODY: I've formated the xml  template as descirbed in the 1197 post. The only parameters I'm passing are the instanceshape and the title. 
HEADERS: {'User-Agent': 'python-requests/2.26.0', 'Accept': 'Application/xml+rdf', OSLC-Core-Version: 2.0, 'content-type': 'Application/xml+rdf', 'Cookie': 'jfs-oauth-token'..'

RESPONSE: 
TYPE: GET
URL: https://<jazz_doman>:<port>/rm/requirementFactory?projectURL=https://<jazz_domain>:<port>/rm/process/project-areas/<rm_project_id>
STATUS : 405 
Response Content
<rdf:RDF
<rdf:Description> 
<err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#String">
>com.ibm.rdm.fronting.server.exception.MethodNotAllowedExcetipion. (Refer to RM server Log)</err:detailedMessage>
>Method Not Allowed</err:errorMessage>
<error:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
>405</errorStatus>
</rdf:description>
</rdf: RDF>

Update: The above is the format i'm trying to implement but in the response I realize the url is trying to do a GET against URI https://<jazz_doman>:<port>/rm/requirementFactory?projectURL=https://<jazz_domain>:<port>/rm/process/project-areas/<rm_project_id>

I'm not sure if something is wrong with the approach or it's with the server itself. Sorry for all the updates.


0 votes

Comments
  1. You do a GET and not a POST
  2. Use application/rdf+xml and not Application/xml+rdf
  3. You can't GET a factory
  4. You should GET a resource shape to understand what the POST body should contain.

It's not the server that's the problem. I guess you're trying to implement this in code; step away from the code and work in a REST client to get the POST to work. Then once you have it working get your code to do the same POST with headers and body etc.

I note you've not even tried to provide a configuration; omitting that is certainly going to limit the chances of the operation working for you.

If you want to observe a Python example then you could look at my OSS elmclient https://github.com/IBM/ELM-Python-Client - there's an example in there dn_simple_createartifact.py see https://github.com/IBM/ELM-Python-Client/tree/master/elmclient/examples. This code utilises the discovery implemented in elmclient, then shows doing the POST to create the artifact.

 I ran this with the commandline:

dn_simple_createartifact.py "Stakeholder Requirement" "My first stakeholder requirement" /
And I then produced a HTML sequence diagram (using log2seq) of the interaction with the server see https://github.com/IBM/ELM-Python-Client/blob/master/elmclient/examples/dn_simple_createartifact_trace.html

The sequence diagram shows the discovery needed to get the requirement creation factory and to discover the configuration hardcoded into the Python example. Anyway the bit you're interested in is right at the bottom of the sequence diagram where POST is used to create an artifact and GET to retrieve the new artifact. The important headers are shown. This trace is against 7.0.2SR1 but this example should work back to 6.0.6/6.0.6.1.

I strongly suggest you start by getting the POST working using a REST client in a logged-in browser.

1 vote

 Thanks for your response Ian. For the "Configuration-Context" what exsctly is the url there? just jazz.com/rm? 

To use the OSLC APIs you'll need to specify a configuration (using parameter oslc_config.context or header Configuration.Context - Note the . not an _) - the configuration URL could be found manually using Share Link To Artifact in the config, or programmatically by discovery looking for the configuration name - for an example of this see https://jazz.net/forum/questions/266334/dng-oslcfetch-components-from-project-area

Ian, 


Thank you for your example. It turns out the authentication part was my issue.  

showing 5 of 6 show 1 more comments

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 62

Question asked: Feb 14 '23, 6:30 p.m.

Question was seen: 3,576 times

Last updated: Feb 28 '23, 8:40 p.m.

Confirmation Cancel Confirm