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

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

 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.

0 votes

Comments

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.


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



One answer

Permanent link

 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>


0 votes

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,941

Question asked: Mar 26 '24, 6:07 a.m.

Question was seen: 574 times

Last updated: Mar 27 '24, 5:05 a.m.

Confirmation Cancel Confirm