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:
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.
|
One answer
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:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
xmlns:acc="http://open-services.net/ns/core/acc#"
xmlns:process="http://jazz.net/ns/process#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:jrs="http://jazz.net/ns/jrs#"
xmlns:oslc_auto="http://open-services.net/ns/auto#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cmx="http://open-services.net/ns/cm-x#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rqm_lm="http://jazz.net/ns/qm/rqm/labmanagement#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rqm_process="http://jazz.net/xmlns/prod/jazz/rqm/process/1.0/"
xmlns:oslc_config="http://open-services.net/ns/config#"
xmlns:oslc_cm="http://open-services.net/ns/cm#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:rqm_qm="http://jazz.net/ns/qm/rqm#"
xmlns:oslc_qm="http://open-services.net/ns/qm#"
xmlns:oslc_rm="http://open-services.net/ns/rm#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<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"/>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">TCER_TestAutomation_creation2</dcterms:title>
<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:weight rdf:datatype="http://www.w3.org/2001/XMLSchema#int">100</rqm_qm:weight>
<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">
<oslc:hidden rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc:hidden>
</rdf:Description>
</rqm_qm:category>
<process:projectArea rdf:resource="<serverUrl>/qm/process/project-areas/_AGocA-oLEeKbeebWK2sm1Q"/>
</oslc_qm:TestExecutionRecord>
</rdf:RDF>
|
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.
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.