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

POST requirement and primary text (with OLSC API) - wrong formatting

 Hi,

I have the following atribute in a requirement <oslc_rm:Requirement>:

I'm trying a simple operation of creating a new requirement with a table in jazz_rm:primaryText:

So I used the link:

===
https://localhost:9443/rm/requirementFactory?projectURL=https://localhost:9443/rm/process/project-areas/_Mu4ToBLbEea_geXMea33fg:
==

With Headers:

OSLC-Core-Version 2.0
Accept application/rdf+xml
Content-Type application/rdf+xml
and I passed the following POST body:

===
rdf:RDF
(..)
            <jazz_rm:primaryText rdf:parseType="Literal">
              div xmlns="http://www.w3.org/1999/xhtml">
                  p dir="ltr"> </p>
                  table border="1" cellpadding="1" cellspacing="1" dir="ltr" id="_1463401786702" style="width:500px">
                    <body>
                          tr>
                              td colspan="1" rowspan="1" style="width: 250px;">a</td>
                              td colspan="1" rowspan="1" style="width: 250px;">1</td>
                          /tr>
                          tr>
                              td colspan="1" rowspan="1" style="width: 250px;">b</td>
                              td colspan="1" rowspan="1" style="width: 250px;">2</td>
                          /tr>
                          tr>
                              td colspan="1" rowspan="1" style="width: 250px;">c</td>
                              td colspan="1" rowspan="1" style="width: 250px;">3</td>
                          /tr>
                      /tbody>
                  /table>
                  p dir="ltr"> </p>
              /div>
            </jazz_rm:primaryText>
(...)

==
I get a 403 response and an error message saying:
===

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:err="http://jazz.net/xmlns/prod/jazz/foundation/1.0/">
  <rdf:Description>
    <err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >CRRRS6401E  Error parsing content. Content must be valid rdf+xml.</err:detailedMessage>
    <err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Forbidden</err:errorMessage>
    <err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
    >403</err:errorStatus>
  </rdf:Description>
</rdf:RDF>
==

"Content must be valid rdf+xml.". What am I doing wrong? If I delete  the <jazz_rm:primaryText > the item is created so I know the problem is there. (I had to remove some opening tags "<" so that tables wouldn't appear

Thank you!

0 votes


Accepted answer

Permanent link
Hi,  I suggest you to manually create an artifact in RM WEB UI that have the desired table, then do a get to that artifact and use the primary text returned there to create a new using oslc.  If that works then try to adapt your primary text to the format exposed by OSLC.
Luis Silva selected this answer as the correct answer

0 votes

Comments

 Hi Gabriel,


That was my first idea. I created an artifact and checked the URI resource link which gave me exactly the format that I used to make the POST. However, when posting, this error appeared..Does the format differ between get and post?

Hi Luis, nop, it must be the same. If that does not work, pls open a defect for it.

 Let me seek further documentation and if the problem remains I will open a defect.

You were absolutely right! I was the one that copied the information from the GET post wrong..

Your answer

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
× 139

Question asked: May 16 '16, 10:28 a.m.

Question was seen: 3,295 times

Last updated: May 18 '16, 11:56 a.m.

Confirmation Cancel Confirm