It's all about the answers!

Ask a question

Help : Authentication using c# code


avinash chilke (1111) | asked May 02 '12, 10:55 a.m.
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);

6 answers



permanent link
Hao Wan (1.5k35) | answered May 03 '12, 2:22 a.m.
JAZZ DEVELOPER
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);

permanent link
avinash chilke (1111) | answered May 04 '12, 7:00 a.m.
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);

permanent link
Hao Wan (1.5k35) | answered May 08 '12, 4:49 a.m.
JAZZ DEVELOPER
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);

permanent link
avinash chilke (1111) | answered May 11 '12, 2:50 a.m.
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);

permanent link
Xiaotao Tang (111) | answered Feb 23 '14, 10:16 a.m.
Hi, I blocked by the same issue. Would you please to share how to solve it?
Thanks in advance?

permanent link
Karthick Raju (1112) | answered Mar 01 '16, 5:09 a.m.

Hi,

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

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.