Programmatic component creation for DNG using OSLC not working in 7.0.3 but in 7.0.2SR1
As described in https://jazz.net/forum/questions/249582/is-there-a-rest-api-for-dng-to-create-a-local-streamcomponent-and-baseline I'm able to create a component in DNG 7.0.1SR1.
When using the same code for DNG 7.0.3, this results in a 404 error. there some
Is this a bug or are there some other changes in 7.0.3
payload, serialized from rdflib:
<?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > <rdf:Description rdf:nodeID="Ne1e5df712cbc49ff8c373e33a187a77d"> <rdf:type rdf:resource="http://open-services.net/ns/config#Component"/> <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral">Comp2 08.12.23 13:46:30</dcterms:title> <dcterms:description rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral">My Description</dcterms:description> </rdf:Description> </rdf:RDF>
header:
myHeaders = {'Accept': 'application/xml',
'OSLC-Core-Version':'2.0',
'Content-Type':'application/rdf+xml# ;charset=UTF-8'
}
post request:
CREATION_FACTORY_URI = "https://elm-laptop.fritz.box:9443/rm/cm/component/ldpc?project=_-uIrkJBKEe6pJ4rHlzMZ-g"
r = myConnection.session.post(CREATION_FACTORY_URI,
auth=(myConnection.uid, myConnection.pw),
allow_redirects=True,
data=g.serialize(format="xml"),
headers=myHeaders,
verify=False,
cookies=myConnection.session.cookies)
print(r.status_code)
print(r.text)
for h in r.headers:
print(h, r.headers[h])
result:
404
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:jfs="http://jazz.net/xmlns/foundation/1.0/"
xmlns:rrm="http://www.ibm.com/xmlns/rrm/1.0/"
xmlns:rrmNav="http://com.ibm.rdm/navigation#"
xmlns:err="http://jazz.net/xmlns/prod/jazz/foundation/1.0/"
xmlns:pref="http://jazz.net/xmlns/alm/rm/Preference/"
xmlns:rmTypes="http://www.ibm.com/xmlns/rdm/types/"
xmlns:rmWorkflow="http://www.ibm.com/xmlns/rdm/workflow/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:h="http://www.w3.org/TR/REC-html40"
xmlns:rmReqIF="http://www.ibm.com/xmlns/rdm/reqif/"
xmlns:xs="http://schema.w3.org/xs/"
xmlns:rrmMulti="http://com.ibm.rdm/multi-request#"
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/">
<rdf:Description>
<err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
>404</err:errorStatus>
<err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Nicht gefunden</err:errorMessage>
<err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>https://elm-laptop.fritz.box:9443/rm/rm-projects/_-uIrkJBKEe6pJ4rHlzMZ-g</err:detailedMessage>
</rdf:Description>
</rdf:RDF>
X-Powered-By Servlet/3.0
Strict-Transport-Security max-age=31536000
Content-Type application/rdf+xml
X-com-ibm-team-Trace-Identifier D84C102B
Content-Encoding gzip
Vary Accept-Encoding
Content-Language de-DE
Set-Cookie JAZZ_AUTH_TOKEN=<token>; Path=/rm; Secure; HttpOnly; SameSite=None
Transfer-Encoding chunked
Connection Close
Date Fri, 08 Dec 2023 12:54:45 GMT
Expires Thu, 01 Dec 1994 16:00:00 GMT
Cache-Control no-cache="set-cookie, set-cookie2"
<div class="jp-OutputArea-promptOverlay" title="Toggle output scrolling">
</div>
<div class="lm-Widget jp-CellFooter jp-Cell-footer">
<br>
</div>
<pre>
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 08 '23, 9:29 a.m.Would not change anything I think, but the header 'Accept': 'application/xml' should be 'Accept': 'application/rdf+xml'
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 11 '23, 4:25 a.m.If you can reproduce this using a REST client (i.e. not using your code but going directly to the OSLC API) then you should create a support case with the details of the API use that doesn't work (i.e. not your code).
Meredith Schmidt
Dec 13 '23, 4:07 a.m.Two situation is the same, right? I feel that: https://jazz.net/forum/questions/275637/410-response-smash karts-while-creating-artifacts-with-oslc-rest-in-dng-version-702
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 13 '23, 4:10 a.m.Please use comments in cases like this. No, the cases are not the same - the version numbers are different. In addition the other post never even came back. The OSLC-Core-Version header is definitively wrong and other headers might be missing..