It's all about the answers!

Ask a question

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

Luis Silva (2557) | asked May 16 '16, 10:28 a.m.
edited May 16 '16, 10:39 a.m.

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:


With Headers:

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

            <jazz_rm:primaryText rdf:parseType="Literal">
              div xmlns="">
                  p dir="ltr"> </p>
                  table border="1" cellpadding="1" cellspacing="1" dir="ltr" id="_1463401786702" style="width:500px">
                              td colspan="1" rowspan="1" style="width: 250px;">a</td>
                              td colspan="1" rowspan="1" style="width: 250px;">1</td>
                              td colspan="1" rowspan="1" style="width: 250px;">b</td>
                              td colspan="1" rowspan="1" style="width: 250px;">2</td>
                              td colspan="1" rowspan="1" style="width: 250px;">c</td>
                              td colspan="1" rowspan="1" style="width: 250px;">3</td>
                  p dir="ltr"> </p>

I get a 403 response and an error message saying:

    <err:detailedMessage rdf:datatype=""
    >CRRRS6401E  Error parsing content. Content must be valid rdf+xml.</err:detailedMessage>
    <err:errorMessage rdf:datatype=""
    <err:errorStatus rdf:datatype=""

"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!

Accepted answer

permanent link
Gabriel Ruelas (1.1k13) | answered May 16 '16, 10:46 a.m.
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

Luis Silva commented May 16 '16, 10:51 a.m. | edited May 16 '16, 10:55 a.m.

 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?

Gabriel Ruelas commented May 16 '16, 10:53 a.m.

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

Luis Silva commented May 16 '16, 11:18 a.m.

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

Luis Silva commented May 18 '16, 11:56 a.m.

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

Your answer

Register or 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.