It's all about the answers!

Ask a question

Getting the error while saving the test script in RQM via c# coding


Milind Modi (634) | asked Jun 16 '14, 6:27 a.m.

Hi,

I am getting the error while saving the test script in RQM via c# coding.

Could you please provide me the code to save test script in RQM via c#?

Thanks & Regards,

Milind Modi.


Comments
Ara Masrof commented Jun 16 '14, 7:14 a.m. | edited Jun 16 '14, 9:44 a.m.
JAZZ DEVELOPER

Milind,

Can you provide additional information and details on what you are trying to attempt?

You have an HTTP client in C# and you are trying to create/update a Test Script? Is so, can you provide the syntax being used and the corresponding error message ?

Ara


Milind Modi commented Jun 16 '14, 7:39 a.m.

Hi Ara,

I am using Rest API to work with Rational QM. I have the object of HTTPWebRequest and i am tring to fetch the Id which are going to create in WebResponse object using "GetResponse" Method but i am not getting that ID. So i am not able to create the Test Script in Rational via C# coding.

Could you please provide me any suggestion?

Regards,

Milind Modi.


Ara Masrof commented Jun 16 '14, 10:30 a.m. | edited Jun 16 '14, 10:31 a.m.
JAZZ DEVELOPER

 Milind,

What URI are you using in your GET request?
If you are looking to get the Test Script feed back you would use something like this:


Milind Modi commented Jun 17 '14, 1:51 a.m.

Hi Ara,

I am trying to use REST API from C# code.

I am facing the issue while saving the test script from c#.

Please provide me correct way to save the Test Script in RQM.

I am using below part of code which is in other comment to save test script.


Milind Modi commented Jun 17 '14, 1:54 a.m.

Continue above Que.

var host = "wegsfes29277clm3.accenture.com/qm/web/console/Sandbox-CLM-General(QM5.0)";

 var baseUrl = string.Format("https://{0}", host);

 var request3 = (HttpWebRequest)WebRequest.Create(string.Format(baseUrl + "/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/SANDBOX/testscript"));

 request3.CookieContainer = RationalHelper.ObjConnectionCookie;

 request3.Method = WebRequestMethods.Http.Post;

 request3.ContentType = "application/octet-stream";

 request3.Accept = "application/*";

byte[] bytes = ASCII.GetBytes(completeXMLTestScript);

 request3.ContentLength = bytes.Length;

 System.IO.Stream os = request3.GetRequestStream()os.Write(bytes, 0, bytes.Length); os.Close();

System.Net.WebResponse resp = request3.GetResponse()

string genratedID = resp.ResponseUri.Segments[5];


Now from here i am not getting the Id which is created in RQM before create the test script.

One answer



permanent link
Paul Slauenwhite (8.4k12) | answered Jun 17 '14, 7:25 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Your RQM Reportable REST API URL uses the /jazz context root but your RQM server uses the /qm context root.

See https://jazz.net/wiki/bin/view/Main/RqmApi#Update for the steps to update a test resource using the RQM Reportable REST API.

Note: Since the RQM Reportable REST API is a REST API and not bound to a specific HTTP client/language,
these types of questions are best asked in context of the RQM Reportable REST API.

Comments
Milind Modi commented Jun 17 '14, 8:02 a.m. | edited Jun 17 '14, 8:39 a.m.

Hi Paul,

Thanks a lot for your response.

I am not able to create the GenerateID for the Test script which are going to create in RQM 4.0.6 via c# coding.  

can you please provide me the code to generate TestScript ID?

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.