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.
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 09 '20, 11:22 a.m.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?
Andy Dennis
Nov 11 '20, 11:43 a.m.Hi Ian,
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 11 '20, 12:41 p.m.No that shouldn't matter. I haven't tried PUT for opt-out.
Andy Dennis
Nov 11 '20, 1:22 p.m.Thanks. I've tried both cases and it seems to not matter. I'll see what i can do with a REST client
Andy Dennis
Nov 12 '20, 6:20 a.m.Made some progress, kind of.
<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>