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

Adding Artifacts to a module with OSLC and the ModuleApi

 I'm almost there with this, however I'm getting a 404 response with the PUT to update the module structure and I don't understand why


I use a Get the resource
            client.Headers.Add("DoorsRP-Request-Type", "public 2.0");
            client.Headers.Add("Accept", "application/rdf+xml"); 
GET https://<server>/rm/resources/_qsUS4R98Eeu9Cbv8kQ-y-Q/structure

I take the etag header and add it to the PUT's If-Match header then put back to the same URL

            client.Headers.Add("DoorsRP-Request-Type", "Public 2.0");
            client.Headers.Add("Accept", "application/rdf+xml");
            client.Headers.Add("Content-Type", "application/rdf+xml");
            client.Headers.Add("If-Match", etag);


PUT https://<server>/rm/resources/_qsUS4R98Eeu9Cbv8kQ-y-Q/structure

Result is a 404 Not Found

I don't understand why this is the case.  I assume I use the /structure suffix to post it back?

Anyone have any thoughts?

Thanks,
Andy.


0 votes

Comments

Yes you PUT back to the exact same URL you did the GET from - NOTE You need to specify the configuration on both the GET and PUT of the module structure (but not on the GET of the module artifact to find the structure URL) - are you doing this?

  Hi Ian, 

Thanks for your response.
No I'm not, but I don't have config management enabled on these projects at the moment. Should that make a difference?

Andy

No that shouldn't matter. I haven't tried PUT for opt-out.


I just noticed your header: "DoorsRP-Request-Type", "Public 2.0"

The overview https://jazz.net/wiki/bin/view/Main/DNGModuleApiOverview shows using "public 2.0" which is what I always use - can you try that?

If that fails, have you tried to do GET then PUT in a browser base REST client like (for Firefox) RESTCLIENT? I suggest you get that to work (200 response) just initially putting back the same structure. Then get it to work with a small change you can check in the module.

Thanks.  I've tried both cases and it seems to not matter.  I'll see what i can do with a REST client

 Made some progress, kind of.

I now get a successful put on the structure but I get this message back when I poll the tracker.
The config I present in the binding is the same as that for the artifact.  It's also the same for the module itself - I don't have config management enabled on the project so I guess this is the default.

If I leave it out, it fails, so not sure what I need to put in here..


      <oslc:Error>

        <oslc:statusCode>400</oslc:statusCode>

        <oslc:message>Propagated exception; original message [BadRequestException: The configuration could not be found.  It could have been delivered or discarded.]</oslc:message>

      </oslc:Error>


Be the first one to answer this question!

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
× 10,937

Question asked: Nov 06 '20, 11:14 a.m.

Question was seen: 939 times

Last updated: Nov 12 '20, 6:20 a.m.

Confirmation Cancel Confirm