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

Help : Authentication using c# code

Hi,

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

I facing issue while authenticating with rational integration service.

Please provide me correct way to autheticate with rational quality manager .

Below code i am using for connection.

Thanks,
Avinash

string result = string.Empty;


string url = @"https://adtjazz3052.accenture.com/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/SANDBOX/testscript/urn:com.ibm.rqm:testscript:119";

HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
//req.Headers.Add("Accept","application/xml");
req.Accept = "application/xml";
req.ContentType = "text/xml";
//CredentialCache creds = new CredentialCache();
NetworkCredential nc = new NetworkCredential("xxxxxx", "xxxx");
//creds.Add(url
req.Credentials = CredentialCache.DefaultCredentials;
req.PreAuthenticate = true;


using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}

Console.Write(result);

0 votes



6 answers

Permanent link
Hi @avinashchilke,
you can refer to the logic in the URLutility sample source code which is written in java.

https://jazz.net/downloads/rational-quality-manager/milestones/4.0RC2/RQM-Extras-RQMUrlUtil-4.0RC2.zip

Hi,

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

I facing issue while authenticating with rational integration service.

Please provide me correct way to autheticate with rational quality manager .

Below code i am using for connection.

Thanks,
Avinash

string result = string.Empty;


string url = @"https://adtjazz3052.accenture.com/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/SANDBOX/testscript/urn:com.ibm.rqm:testscript:119";

HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
//req.Headers.Add("Accept","application/xml");
req.Accept = "application/xml";
req.ContentType = "text/xml";
//CredentialCache creds = new CredentialCache();
NetworkCredential nc = new NetworkCredential("xxxxxx", "xxxx");
//creds.Add(url
req.Credentials = CredentialCache.DefaultCredentials;
req.PreAuthenticate = true;


using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}

Console.Write(result);

0 votes


Permanent link
Hi Hao Wan ,

I have download RQMURLUtil , but i did not find any souce code there.

As i am .net developer, i donot know how to open jar file.

Can you please provide me sample code on this.

Thanks,


Hi @avinashchilke,
you can refer to the logic in the URLutility sample source code which is written in java.

https://jazz.net/downloads/rational-quality-manager/milestones/4.0RC2/RQM-Extras-RQMUrlUtil-4.0RC2.zip

Hi,

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

I facing issue while authenticating with rational integration service.

Please provide me correct way to autheticate with rational quality manager .

Below code i am using for connection.

Thanks,
Avinash

string result = string.Empty;


string url = @"https://adtjazz3052.accenture.com/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/SANDBOX/testscript/urn:com.ibm.rqm:testscript:119";

HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
//req.Headers.Add("Accept","application/xml");
req.Accept = "application/xml";
req.ContentType = "text/xml";
//CredentialCache creds = new CredentialCache();
NetworkCredential nc = new NetworkCredential("xxxxxx", "xxxx");
//creds.Add(url
req.Credentials = CredentialCache.DefaultCredentials;
req.PreAuthenticate = true;


using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}

Console.Write(result);

0 votes


Permanent link
hi @avinashchilke,
you can just use 7-zip to unzip the jar file then you can see the java source code, it's similar to the C#
Hi Hao Wan ,

I have download RQMURLUtil , but i did not find any souce code there.

As i am .net developer, i donot know how to open jar file.

Can you please provide me sample code on this.

Thanks,


Hi @avinashchilke,
you can refer to the logic in the URLutility sample source code which is written in java.

https://jazz.net/downloads/rational-quality-manager/milestones/4.0RC2/RQM-Extras-RQMUrlUtil-4.0RC2.zip

Hi,

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

I facing issue while authenticating with rational integration service.

Please provide me correct way to autheticate with rational quality manager .

Below code i am using for connection.

Thanks,
Avinash

string result = string.Empty;


string url = @"https://adtjazz3052.accenture.com/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/SANDBOX/testscript/urn:com.ibm.rqm:testscript:119";

HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
//req.Headers.Add("Accept","application/xml");
req.Accept = "application/xml";
req.ContentType = "text/xml";
//CredentialCache creds = new CredentialCache();
NetworkCredential nc = new NetworkCredential("xxxxxx", "xxxx");
//creds.Add(url
req.Credentials = CredentialCache.DefaultCredentials;
req.PreAuthenticate = true;


using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}

Console.Write(result);

0 votes


Permanent link
Thanks ....:)

Issue is resolve.

Regard's
Avinash

Hi @avinashchilke,
you can refer to the logic in the URLutility sample source code which is written in java.

https://jazz.net/downloads/rational-quality-manager/milestones/4.0RC2/RQM-Extras-RQMUrlUtil-4.0RC2.zip

Hi,

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

I facing issue while authenticating with rational integration service.

Please provide me correct way to autheticate with rational quality manager .

Below code i am using for connection.

Thanks,
Avinash

string result = string.Empty;


string url = @"https://adtjazz3052.accenture.com/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/SANDBOX/testscript/urn:com.ibm.rqm:testscript:119";

HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
//req.Headers.Add("Accept","application/xml");
req.Accept = "application/xml";
req.ContentType = "text/xml";
//CredentialCache creds = new CredentialCache();
NetworkCredential nc = new NetworkCredential("xxxxxx", "xxxx");
//creds.Add(url
req.Credentials = CredentialCache.DefaultCredentials;
req.PreAuthenticate = true;


using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(resp.GetResponseStream());
result = reader.ReadToEnd();
}

Console.Write(result);

0 votes


Permanent link
Hi, I blocked by the same issue. Would you please to share how to solve it?
Thanks in advance?

0 votes


Permanent link

Hi,

I am also facing the same issue. Could you share the sample? Thanks in Advance!

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

Question asked: May 02 '12, 10:55 a.m.

Question was seen: 6,586 times

Last updated: Mar 01 '16, 5:09 a.m.

Confirmation Cancel Confirm