It's all about the answers!

Ask a question

XML format for creating a testscript using REST API.


Aniketh Udupa (122) | asked Mar 07 '14, 5:44 a.m.
 Hello, 

My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
	<ns4:testscript xmlns:ns4="http://jazz.net/xmlns/alm/qm/v0.1/"
	xmlns:ns1="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1"
	xmlns:ns3="http://schema.ibm.com/vega/2008/"
	xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/"
	xmlns:ns6="http://purl.org/dc/elements/1.1/"
	xmlns:ns7="http://jazz.net/xmlns/prod/jazz/process/0.6/"
	xmlns:ns8="http://purl.org/dc/terms/"
	xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/"
	xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/">
	<ns4:projectArea alias="Sample+Quality+Management++%28Quality+Management%29" 
	href="https://localhost:9443/qm/resource/itemOid/com.ibm.team.process.ProjectArea/_MmcaQqRVEeOKo6LKESv69g"/>
	<ns6:title>MyDocument</ns6:title>
	<ns6:description>This is a test document
	</ns6:description>
	<ns4:scripttype>com.ibm.rqm.planning.common.scripttype.manual</ns4:scripttype>
	<ns4:steps>
	<ns10:step type="execution">
	<ns10:name>This is a test document</ns10:name>
	<ns10:title>This is a test document</ns10:title>
	<ns10:description>
	<div:div xmlns:div="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">Expected result</div:div>
	</ns10:description>
	<ns10:expectedResult>
	<div:div xmlns:div="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">Expected result</div:div>
	</ns10:expectedResult>
	</ns10:step>
	</ns4:steps>
	</ns4:testscript>
And I am trying to post it using the URL: 
https://localhost:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_MmcaQqRVEeOKo6LKESv69g/testscript

I am getting HTTP 302 error. Can someone tell me whether the XML format is proper for creating testscript using REST API. Also do we need to POST it or PUT?

Thanks,
Aniketha

2 answers



permanent link
Reshma Ratnani (1.1k1) | answered Mar 07 '14, 5:51 a.m.
JAZZ DEVELOPER
Hi Aniketha,

The url to POST the testscript should be
https://localhost:9443/qm/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ProjectAreaName/testscript/testscriptId

here testscriptId can be any value



Comments
Reshma Ratnani commented Mar 07 '14, 5:53 a.m.
JAZZ DEVELOPER

Also wanted to add that the xml is correct and you can use anything POST or PUT. Preferable is PUT.


Aniketh Udupa commented Mar 07 '14, 7:35 a.m.

 I changed my URL to :


If i do POST i get the following error:
java.lang.Exception: Error occured while posting
HTTP/1.1 302 Found

If i do PUT, no error but test script will not be created

What might be the reason?

Thanks,
Aniketha


permanent link
Dinesh Kumar (4.0k413) | answered Mar 09 '14, 2:28 p.m.
JAZZ DEVELOPER
here is what the HTTP Status Code means
302     Found     The resource is available at a different location. The URL is available in the Location HTTP response header
what URL do you see in the Location HTTP response header!

Comments

Aniketh Udupa commented Mar 10 '14, 3:21 a.m.

Even if I post it to the above URL nothing is happening. Please help me out. 

Your answer


Register or to post your answer.