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

Error creating a draft work item - oslc rest api

I'm trying to create a draft work item by REST OSLC api, but occurred this error:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#" >
  <rdf:Description rdf:nodeID="A0">
    <oslc:message>null argument:</oslc:message>
    <oslc:statusCode>500</oslc:statusCode>

    <rdf:type rdf:resource="http://open-services.net/ns/core#Error"/>
  </rdf:Description>
</rdf:RDF>

My code:

writer.append("<rdf:RDF"
                        + " xmlns:dcterms=\"http://purl.org/dc/terms/\""
                        + " xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" "
                        + " xmlns:rtc_cm=\"http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/\"  "
                        + " xmlns:oslc_cm=\"http://open-services.net/ns/cm#\" "
                        + " > "
                        + " <rdf:Description rdf:nodeID=\"A0\">"
                        + "  <dcterms:title rdf:parseType=\"Literal\">Sample Work Item benito teste 2</dcterms:title>"
                        + "     <dcterms:type>myworkitem.id</dcterms:type>"
                        + "</rdf:Description>"
                        + "</rdf:RDF>"
                        + "");

        HttpEntity entity = new EntityTemplate(cp);
        HttpPost post = new HttpPost("https://localhost:9443/ccm/oslc/contexts/__BPpZQVkEeWXyenpHV3PTg/drafts/workitems/");          
       
        post.addHeader("Accept", "application/rdf+xml");
        post.addHeader("Content-Type", "application/rdf+xml");
        post.addHeader("OSLC-Core-Version", "2.0");
        post.setEntity(entity);

I read this https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=353253

but i dont kown if is the same problem.

0 votes


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,927
× 515
× 478

Question asked: Jun 01 '15, 2:32 p.m.

Question was seen: 3,572 times

Last updated: Jun 01 '15, 2:35 p.m.

Confirmation Cancel Confirm