PUT method in DNG to update artifact is not working
Hi Team,
We are using DNG 7.0.2 SR1
We are trying to update DNG artifact from GC enabled project area by referring below document:
We are using below API:
Input Text:
<rdf:RDF
<rdf:Description rdf:about="https://servername/rm/resources/BI_Dlbl4AqtEe69NrAZG_EKYw?oslc_config.context=https%3A%2F%2Fservername%2Frm%2Fcm%2Fstream%2F_zyIJ8LgSEe21Q_607LRcZA">
<oslc:serviceProvider rdf:resource="https://servername/rm/oslc_rm/Ou6HwCo7EeuYz8KHPSBUuA/services.xml"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2023-06-14T12:14:48.156Z</dcterms:created>
<process:projectArea rdf:resource="https://servername/rm/process/project-areas/_Ou6HwCo7EeuYz8KHPSBUuA"/>
<dcterms:contributor rdf:resource="https://servername/jts/users/username"/>
<rdf:type rdf:resource="http://nexteer.com/artifacttype/Heading"/>
<rdf:type rdf:resource="http://open-services.net/ns/rm#Requirement"/>
<rdf:type rdf:resource="http://jazz.net/ns/rm#Text"/>
<dcterms:title rdf:parseType="Literal">Introduction to DNG Utility</dcterms:title>
<oslc_config:component rdf:resource="https://servername/rm/cm/component/_zx6ukLgSEe21Q_607LRcZA"/>
<dcterms:description rdf:parseType="Literal"></dcterms:description>
<acp:accessControl rdf:resource="https://servername/rm/accessControl/_Ou6HwCo7EeuYz8KHPSBUuA"/>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2023-06-14T12:14:48.156Z</dcterms:modified>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">5590415</dcterms:identifier>
<dcterms:creator rdf:resource="https://servername/jts/users/WZ8838"/>
<oslc:instanceShape rdf:resource="https://servername/rm/types/OT_zz-kILgSEe21Q_607LRcZA"/>
<jazz_rm:primaryText rdf:parseType="Literal">
<div
<p id="_1686744887948">Introduction</p>
</div>v
</jazz_rm:primaryText>
</rdf:Description>
</rdf:RDF>
Headers:
Content-Type: application/rdf+xml
If-Match: TX_VSp6VbgTEe21Q_607LRcZA
Etag: "%220%22&%22-egKwOpfEe205cHiX6_oiQ%26_-eb5UOpfEe205cHiX6_oiQ%22"
"Etag header is getting from GET method of same URL"
We are getting below error
412: Precondition failed
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
<rdf:Description>
<err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>com.ibm.rdm.fronting.server.exception.PreconditionFailedException</err:detailedMessage>
<err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Precondition Failed</err:errorMessage>
<err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
>412</err:errorStatus>
</rdf:Description>
</rdf:RDF>
Please anyone help me on it.
Thanks
Comments
David Honey
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 14 '23, 9:02 a.m.Does the etag specified in your
If-Matchheader match the current etag of the artifact you are updating? A mismatch between the two is the most common pause of a precondition failure.Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 15 '23, 3:17 a.m.2) there's no need for an etag header on the PUT.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 15 '23, 3:55 a.m.Is the oslc_config.context in the request body supposed to be URL encoded?
<rdf:Description rdf:about="https://servername/rm/resources/BI_Dlbl4AqtEe69NrAZG_EKYw?oslc_config.context=https%3A%2F%2Fservername%2Frm%2Fcm%2Fstream%2F_zyIJ8LgSEe21Q_607LRcZA">
David Honey
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 15 '23, 4:13 a.m.Yes, all values to all query parameters should be URL encoded.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 15 '23, 4:30 a.m.It is in the RDF of the request body and it is not mentioned as query parameter.
None of the other values in the request body RDF are URL encoded.
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 15 '23, 12:40 p.m.This RDF should be only: what was received from a GET, with modifications only where they are needed. If the config was received encoded then it should still be encoded for the PUT. I just tried a get and the config is URL-encoded.