TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tanmayee sahoo
NA
3
0
System.Net.WebException: The request was aborted: The request was canceled. at System.Net.HttpWebRequest.GetResponse()
Aug 12 2009 4:45 AM
Hi,
I am developing a web service to integrate QuickBooks data with a CRM using C#.
CRM API exposes a method to get data from CRM.
I am calling the method to get the data from CRM inside back ground worker and doing some other stuff in the fore ground. Below is the code i have written to accomplish the task
public DataTable GetZohoAccountRecords(string zohoTicket)
{
DataTable dtZohoAccount = new DataTable();
string apiKey = ConfigurationManager.AppSettings["ApiKey"].ToString();
string accountURL = ConfigurationManager.AppSettings["GetAccountURL"].ToString() + zohoTicket + "&apikey=" + apiKey;
gWebRequest = (HttpWebRequest)GetWebRequest(new Uri(accountURL));
gWebRequest.Method = "GET";
//------For getting the Web Response---------
gWebResponse = (HttpWebResponse)gWebRequest.GetResponse();
Stream responseStream = gWebResponse.GetResponseStream();
Stream Reader streamReader = new StreamReader(responseStream);
zohoResponse = streamReader.ReadToEnd();
}
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = null;
try
{
webRequest = (HttpWebRequest)base.GetWebRequest(uri);
webRequest.KeepAlive = false;
//webRequest.ProtocolVersion = HttpVersion.Version10;
}
catch (Exception ex)
{
gQbws.WriteToLogFile("Exception in overriding GetWebRequest\t" + ex.ToString());
}
return webRequest;
}
I am getting System.Net.WebException: The request was aborted: The request was canceled. at System.Net.HttpWebRequest.GetResponse() while trying to get records from CRM.
Can anyone please tell me why I am getting this exception and what do I do to fix this exception.
Any help would be highly appeciated.
thanks
tanmayee
Reply
Answers (
5
)
CrossWordPuzzle
Picture Preview