It's all about the answers!

Ask a question

Need help with calling RQM REST APIs through .NET


Prabhasana vanka (411) | asked Mar 02 '12, 5:07 p.m.
Hi All,

I am battling with this problem since a couple of days.
Here is what i am trying to achieve - Fetch a work item details (summary, description )into a .NET client through the REST API's
This is the code i have written so far in a console .NET app
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{

//ServicePointManager.ServerCertificateValidationCallback

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(
delegate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
return true;
});

HttpWebRequest request = WebRequest.Create("https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/workitem/7341") as HttpWebRequest;
///com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/workitem/7341
//request.Method = "GET";
// request.ContentType = "application/xml";
//request.Accept ="Accept";
request.ContentType = "application/xml";
string result = null;
request.Credentials = CredentialCache.DefaultCredentials;

using (HttpWebResponse resp = request.GetResponse()
as HttpWebResponse)
{
// string ReUri =

// resp.ContentType = "application/xml";
StreamReader reader =
new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();

}


}

}
}

I am expecting to get the XML atleast of the login page since that is the page that has to be displayed on hitting the url specified above
However , the result that i always get is that of html and is

<DOCTYPE>

<Licensed>

<html>

<head>
<meta>
<meta>
<title></title>

<link>
<link>

<style>
#net-jazz-ajax-NoScriptMessage {
width: 100%;
color: #D0D0D0;
font-size: 2em;
text-align: center;
position: absolute;
top: 1%;
z-index: 999;
}
</style>

</head>

<body>
<noscript><div>Javascript is either disabled or not available in your Browser</div></noscript>
<div>Loading...</div>
<div></div>

<script>
djConfig = {
isDebug: false,
usePlainJson: true,
baseUrl: "/jazz/web/dojo/",
locale: "en-us",
localizationComplete: true
};
/*null*/
net = {jazz: {ajax: {}}};
net.jazz.ajax._contextRoot = "/jazz";
net.jazz.ajax._webuiPrefix = "/web/";
</script>

<script></script>


<script>
/* <CDATA> */
</script>

<script>
/* <CDATA> */
</script>
</body>
</html>

I am stuck at this point and not able to get further ideas.

Any help is highly appreicated

Thanks

11 answers



permanent link
Paul Slauenwhite (8.4k12) | answered Mar 05 '12, 8:56 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
A couple of comments:

-Your authentication is not working correctly since the HTML page is requesting a user log-in.

-If workitem ID 7431 is the internal ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID), you will need to use the urn:com.ibm.rqm:workitem:7431 internal ID.

permanent link
Prabhasana vanka (411) | answered Mar 05 '12, 12:56 p.m.
Hi Paul,

I changed the url to "

https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Quality+Manager/urn:com.ibm.rqm:WorkItem:7342"

as per your suggestion to use the internal ID of the work Item

However ,I still get the same HTML output I pasted in my earlier post.

Please let me know if you have any other ideas

Thanks


quote="paules"]A couple of comment:

-Your authentication is not working correctly since the HTML page is requesting a user log-in.

-If workitem ID 7431 is the internal ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID), you will need to use the urn:com.ibm.rqm:workitem:7431 internal ID.

permanent link
Paul Slauenwhite (8.4k12) | answered Mar 05 '12, 2:39 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Correct, the request would not work if you are not authenticated with the server. You need to resolve the authentication issue before making the request.

The resource type in the internal ID (https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID) is case sensitive (see https://jazz.net/wiki/bin/view/Main/RqmApi#Resources_and_their_Supported_Op). For example, urn:com.ibm.rqm:workitem:7342.

You can test your HTTP request by using Poster (https://jazz.net/wiki/bin/view/Main/RQMUsingPoster).

permanent link
William Lucas (1823) | answered Mar 09 '12, 6:51 p.m.
Paul, After authenticating I get 404 stating unavailable resource. The work item in this case is a defect not associated with any of the available resources (i.e. testsuite, testscript, testplan, etc.)

Here is the URL I used:
https://pdbvwmaprat.nw.lbps.com:9443/jazz/com.ibm.rqm.integration.service.IIntegrationService/projects/Quality+Manager/urn:com.ibm.rqm:workitem:7342

NOTE: I tried using qm in the contextroot but I believe we configured it to use jazz during installation.

We were using RQM 2.0 before migrating to the CLM 3.0.1.1 platform but were unable to obtain anything from the RQM REST API when we were on 2.0. I was told that the workitem resouce for defects was only included in RTC and since we didn't own RTC licenses, we could not access any of the REST services. We're now using CLM but defects are still entered in RQM. We do have more access to RTC now but still don't own the full version. Is what "vanka" is attempting even possible with our current implementation. If so, please advise.

permanent link
Hao Wan (1.5k35) | answered Mar 11 '12, 10:20 p.m.
JAZZ DEVELOPER
hi devwillie,
if it is still not working, you can try to change the url to
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Quality+Manager/workitem/urn:com.ibm.rqm:workitem:7342"

and you can try to paste the url to the internet explorer, if it's the correct url you can see the xml

Hi Paul,

I changed the url to "

https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Quality+Manager/urn:com.ibm.rqm:WorkItem:7342"

as per your suggestion to use the internal ID of the work Item

However ,I still get the same HTML output I pasted in my earlier post.

Please let me know if you have any other ideas

Thanks


quote="paules"]A couple of comment:

-Your authentication is not working correctly since the HTML page is requesting a user log-in.

-If workitem ID 7431 is the internal ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID), you will need to use the urn:com.ibm.rqm:workitem:7431 internal ID.

permanent link
Prabhasana vanka (411) | answered Mar 12 '12, 11:39 a.m.
Hi ,

Just pasted your suggested url ".............../workitem/urn:com.ibm.rqm:workitem:7342 in the browser and after authenticating myself into RQM website - I get the message "The request sent by the client is syntactically incorrect"



hi devwillie,
if it is still not working, you can try to change the url to
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Quality+Manager/workitem/urn:com.ibm.rqm:workitem:7342"

and you can try to paste the url to the internet explorer, if it's the correct url you can see the xml

Hi Paul,

I changed the url to "

https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Quality+Manager/urn:com.ibm.rqm:WorkItem:7342"

as per your suggestion to use the internal ID of the work Item

However ,I still get the same HTML output I pasted in my earlier post.

Please let me know if you have any other ideas

Thanks


quote="paules"]A couple of comment:

-Your authentication is not working correctly since the HTML page is requesting a user log-in.

-If workitem ID 7431 is the internal ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID), you will need to use the urn:com.ibm.rqm:workitem:7431 internal ID.

permanent link
Hao Wan (1.5k35) | answered Mar 12 '12, 9:56 p.m.
JAZZ DEVELOPER
hi ,
if the server start successfully , you can see all the workitems in the following url
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/workitem

and all testcasse in the following
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/testcase

and just found projects should be resources
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/workitem/urn:com.ibm.rqm:workitem:7342

if not I think there's some problems with your server.
Hi ,

Just pasted your suggested url ".............../workitem/urn:com.ibm.rqm:workitem:7342 in the browser and after authenticating myself into RQM website - I get the message "The request sent by the client is syntactically incorrect"



hi devwillie,
if it is still not working, you can try to change the url to
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Quality+Manager/workitem/urn:com.ibm.rqm:workitem:7342"

and you can try to paste the url to the internet explorer, if it's the correct url you can see the xml

Hi Paul,

I changed the url to "

https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/projects/Quality+Manager/urn:com.ibm.rqm:WorkItem:7342"

as per your suggestion to use the internal ID of the work Item

However ,I still get the same HTML output I pasted in my earlier post.

Please let me know if you have any other ideas

Thanks


quote="paules"]A couple of comment:

-Your authentication is not working correctly since the HTML page is requesting a user log-in.

-If workitem ID 7431 is the internal ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID), you will need to use the urn:com.ibm.rqm:workitem:7431 internal ID.

permanent link
Prabhasana vanka (411) | answered Mar 28 '12, 9:06 a.m.
Hi,

I am trying to get Requirement and Defect type workitems using the REST API Url :
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/workitem?fields=feed/entry/content/workitem/*

however , I get all work items even those that dont satisfy the ownerid condition

Does anybody have any idea why this isnt working?

Any help is greatly appreciated

permanent link
Hao Wan (1.5k35) | answered Mar 28 '12, 10:57 p.m.
JAZZ DEVELOPER
@vanka,

please change ownerid to owner.

Hi,

I am trying to get Requirement and Defect type workitems using the REST API Url :
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/workitem?fields=feed/entry/content/workitem/*

however , I get all work items even those that dont satisfy the ownerid condition

Does anybody have any idea why this isnt working?

Any help is greatly appreciated

permanent link
Prabhasana vanka (411) | answered Mar 29 '12, 9:18 a.m.
I did change the ownerid toowner.

But I am still getting workitems which donot belong to the owner specified in the filtering condition

Please help if you have any other ideas or suggestions

Thanks@vanka,

please change ownerid to owner.

Hi,

I am trying to get Requirement and Defect type workitems using the REST API Url :
https://pdbvwmaprat.nw.lbps.com:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/workitem?fields=feed/entry/content/workitem/*

however , I get all work items even those that dont satisfy the ownerid condition

Does anybody have any idea why this isnt working?

Any help is greatly appreciated

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.