It's all about the answers!

Ask a question

ETM : Error while creating the TCER through OSLC API. 400 Bad Request.

Shwetha G (112) | asked Mar 26, 6:07 a.m.
edited Mar 26, 6:11 a.m.

 Hello Team,

I am trying to create a TestCase Execution Record using the OSLC API:

On triggering the API in RESTClient, it is creating the TCER successfully. But when I am triggering the API via Java Code, it is giving me Error :
<oslc:message>AQXCM5012E The resource could not be retrieved or created.</oslc:message>

From this Link got the error details:
Message AQXCM5012E The resource could not be retrieved or created.
Explanation The XML code was not a valid representation of the resource.
User action Review the XML code, fix any errors, and then retry the operation.

The same API and Payload am using in the Rest Client, it is generating the TCER. 

What could be the issue with the payload, I am passing all the mandatory fields for the creation of TCER ? Can you please share the sample TCER payload ?


Ralph Schoon commented Mar 27, 3:04 a.m. | edited Mar 27, 3:06 a.m.

I would not expect to get an answer, because there is no information provided that would be of any use. Triggering the API is not a concept that makes sense. If you post to a creation factory then provide that information. Provide the headers you sent and provide the body you sent. 

There are numerous reasons thy your post could fail. 400 is method not allowed. This could indicate anything, for example incorrect or missing headers, incorrect URI, incorrect body, incorrectly encoded body and countless other issues. 

Provide at least the request status, the response headers and the response body, if there is one.

Shwetha G commented Mar 27, 5:05 a.m.

Ralph, Could you please share the sample Request payload for TCER creation.

One answer

permanent link
Shwetha G (112) | answered Mar 27, 3:51 a.m.

 Thanks for the response Ralph.

Following are the headers :
 "Content-Type", "application/rdf+xml"
 "Accept", "application/rdf+xml"

Following is the Request payload:
<?xml version="1.0" encoding="UTF-8"?>
   <oslc_qm:TestExecutionRecord rdf:about="<serverUrl>/qm/oslc_qm/contexts/_AGocA-oLEeKbeebWK2sm1Q/resources/">
    <rqm_process:hasPriority rdf:resource="<serverUrl>/qm/service/"/>
    <oslc_qm:runsTestCase rdf:resource="<serverUrl>/qm/oslc_qm/contexts/_AGocA-oLEeKbeebWK2sm1Q/resources/"/>
    <process:teamArea rdf:resource="<serverUrl>/qm/process/team-areas/_LI13sNwXEeyfn9GxZyTPLg"/>
    <oslc_qm:reportsOnTestPlan rdf:resource="<serverUrl>/qm/oslc_qm/contexts/_AGocA-oLEeKbeebWK2sm1Q/resources/"/>
    <dcterms:contributor rdf:resource="<serverUrl>/jts/users/SHW8KOR"/>
    <oslc_config:component rdf:resource="<serverUrl>/qm/oslc_config/resources/"/>
    <oslc:serviceProvider rdf:resource="<serverUrl>/qm/oslc_qm/contexts/_AGocA-oLEeKbeebWK2sm1Q/services.xml"/>
    <rqm_qm:category_s2jcgSXNEeyd5tWxecMDQQ rdf:resource="<serverUrl>/qm/service/"/>
     <rdf:Description rdf:about="<serverUrl>/qm/service/">
    <process:projectArea rdf:resource="<serverUrl>/qm/process/project-areas/_AGocA-oLEeKbeebWK2sm1Q"/>

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.