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);
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
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
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);
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,
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);
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#
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);
Thanks ....:)
Issue is resolve.
Regard's
Avinash
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);