[closed] Not able to connect ClearQuest by programmatically
Raja P (15●2●6)
| asked Dec 13 '17, 4:15 a.m.
closed Dec 13 '17, 5:39 a.m. by Ralph Schoon (63.1k●3●36●46) I have to get all the defect details from ClearQuest and I have implemented the below using C#
string _serverURL = "https://cqweb.xxxx.com/cqweb/";
string _resourceURL = "https://cqweb.xxxx.com/cqweb/restapi/7.0.0/xxx/?format=XML&loginId=xxxxx&password=xxxxxxx";
CookieContainer _cookies = new CookieContainer();
HttpWebRequest documentGet = (HttpWebRequest)WebRequest.Create(resourceURL);
documentGet.Method = method;
documentGet.CookieContainer = _cookies;
documentGet.ContentType = "application/rdf+xml";
documentGet.Accept = mediatype;
documentGet.Headers.Set("OSLC-Core-Version", "3.0");
documentGet.Timeout = 300000;
HttpWebRequest _requestClone = (HttpWebRequest)WebRequest.Create(_request.RequestUri);
//store the response in _docResponse variable
HttpWebResponse _docResponse = (HttpWebResponse)_request.GetResponse();
//HttpStatusCode.OK indicates that the request succeeded and that the requested information is in the response.
if (_docResponse.StatusCode == HttpStatusCode.OK)
{
//X-com-ibm-team-repository-web-auth-msg header signifies form based authentication is being used
string _rtcAuthHeader = _docResponse.Headers["X-com-ibm-team-repository-web-auth-msg"];
if ((_rtcAuthHeader != null) && _rtcAuthHeader.Equals("authrequired"))
{
_docResponse.GetResponseStream().Flush();
_docResponse.Close();
//Prepare form for authentication as _rtcAuthHeader = authrequired
HttpWebRequest _formPost = (HttpWebRequest)WebRequest.Create(_rtcServerURL + "/j_security_check");
_formPost.Method = "POST";
_formPost.Timeout = 30000;
_formPost.AutomaticDecompression = DecompressionMethods.None;
_formPost.CookieContainer = _request.CookieContainer;
_formPost.Accept = "text/xml";
_formPost.ContentType = "application/x-www-form-urlencoded";
getting Bad request error.
Kindly anyone help me to get this resolved.
|
Comments
Wrong Forum. ClearQuest is not part of Jazz Technology so you will have to contact IBM Support directly for this.