It's all about the answers!

Ask a question

Error when create workitem via Rest API


Ruslan Luchnikov (3121311) | asked Aug 02 '12, 2:38 a.m.
edited Aug 02 '12, 10:18 a.m.
Hi, guys
I try create workitem via Rest API with attribute(Description) containing text inside  <text>.  After creating wortkiten in Rational Team Concert the text and <> is removed.
REQUEST BODY:
<oslc_cm:ChangeRequest xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:oslc_disc="http://open-services.net/xmlns/discovery/1.0/" xmlns:dc="http://purl.org/dc/terms/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/" xmlns:jp="http://jazz.net/xmlns/prod/jazz/process/1.0/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:oslc_qm="http://open-services.net/xmlns/qm/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" xmlns:jd="http://jazz.net/xmlns/prod/jazz/discovery/1.0/" xmlns:oslc_rm="http://open-services.net/xmlns/rm/1.0/"><dc:type rdf:resource="https://stend-fr2:9443/jazz/oslc/types/https://eld64:9443/jazz/oslc/contexts/_dlsysLIzEeGCN8XOKY-7rQ/workitems/ЗНИ"/><dc:description>test <test> test</dc:description><rtc_cm:id_ppmc>132403</rtc_cm:id_ppmc><dc:title>132403 <test> 12345</dc:title><rtc_project_name>Test</rtc_project_name><rtc_cm:state></rtc_cm:state><rtc_cm:автор>Admin User</rtc_cm:автор><rtc_cm:номер>132111</rtc_cm:номер></oslc_cm:ChangeRequest>

2 answers



permanent link
Lionel Li (23111216) | answered Aug 02 '12, 2:23 p.m.
JAZZ DEVELOPER
edited Aug 03 '12, 9:32 a.m.
The error is caused most likely by the illegal char "<" and ">" to the xml entity

http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

you can give a try with

<dc:description>test &amp;lt; &amp;lt;  &amp;gt; &amp;gt; test</dc:description>

hope it works

permanent link
Ruslan Luchnikov (3121311) | answered Aug 06 '12, 5:12 a.m.
edited Aug 06 '12, 5:33 a.m.
Hi all
i try encode under XML specification(How i can insert HTML in forum?)
And in time creating workitem the text area between symbols (&lt and &gt) and symbols themselves were removed.

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.