It's all about the answers!

Ask a question

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


Shwetha G (11578) | 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:
<server>/qm/oslc_qm/contexts/<projectContext>/resources/com.ibm.rqm.execution.TestcaseExecutionRecord

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:statusCode>400</oslc:statusCode>
<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 ?

Thanks.


Comments
Ralph Schoon commented Mar 27, 3:04 a.m. | edited Mar 27, 3:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.
Thanks.

One answer



permanent link
Shwetha G (11578) | 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"?>
<rdf:RDF
  xmlns:rqm_auto="http://jazz.net/ns/auto/rqm#"
  xmlns:acp="http://jazz.net/ns/acp#"
  xmlns:process="http://jazz.net/ns/process#"
  xmlns:dcterms="http://purl.org/dc/terms/"
  xmlns:jrs="http://jazz.net/ns/jrs#"
  xmlns:oslc_config="http://open-services.net/ns/config#"
  xmlns:rqm_qm="http://jazz.net/ns/qm/rqm#"
 
   <oslc_qm:TestExecutionRecord rdf:about="<serverUrl>/qm/oslc_qm/contexts/_AGocA-oLEeKbeebWK2sm1Q/resources/com.ibm.rqm.execution.TestcaseExecutionRecord/">
    
    <rqm_process:hasPriority rdf:resource="<serverUrl>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/process-info/_AGocA-oLEeKbeebWK2sm1Q/priority/literal.priority.101"/>
    <oslc_qm:runsTestCase rdf:resource="<serverUrl>/qm/oslc_qm/contexts/_AGocA-oLEeKbeebWK2sm1Q/resources/com.ibm.rqm.planning.VersionedTestCase/__BX48OtVEe68XZmrpXoQ9A"/>
    
    <process:teamArea rdf:resource="<serverUrl>/qm/process/team-areas/_LI13sNwXEeyfn9GxZyTPLg"/>
    <oslc_qm:reportsOnTestPlan rdf:resource="<serverUrl>/qm/oslc_qm/contexts/_AGocA-oLEeKbeebWK2sm1Q/resources/com.ibm.rqm.planning.VersionedTestPlan/_Y7Sn4dSaEe6iar4b3KrCWw"/>
    <dcterms:contributor rdf:resource="<serverUrl>/jts/users/SHW8KOR"/>
    
    <oslc_config:component rdf:resource="<serverUrl>/qm/oslc_config/resources/com.ibm.team.vvc.Component/_WbogAeedEeWRV7PM2vrZTw"/>
    <oslc:serviceProvider rdf:resource="<serverUrl>/qm/oslc_qm/contexts/_AGocA-oLEeKbeebWK2sm1Q/services.xml"/>
    
    <rqm_qm:category_s2jcgSXNEeyd5tWxecMDQQ rdf:resource="<serverUrl>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ProjectPlay_Ba+%28Qualit%C3%A4tsmanagement%29/category/urn:com.ibm.rqm:category:_1N5h8SXNEeyd5tWxecMDQQ#"/>
    
    <rqm_qm:category>
     <rdf:Description rdf:about="<serverUrl>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ProjectPlay_Ba+%28Qualit%C3%A4tsmanagement%29/category/urn:com.ibm.rqm:category:_1N5h8SXNEeyd5tWxecMDQQ">
     </rdf:Description>
    </rqm_qm:category>
    <process:projectArea rdf:resource="<serverUrl>/qm/process/project-areas/_AGocA-oLEeKbeebWK2sm1Q"/>
   </oslc_qm:TestExecutionRecord>
</rdf:RDF>


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.