Click here to Skip to main content
15,887,333 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

How to override the
WebRequest GetWebRequest(Uri uri)
method of a web request in an asp.net web application when calling a webservice


Thanks
Posted
Updated 25-Feb-20 1:34am

1 solution

If some method of virtual, you can override it. :-)
Please see: https://msdn.microsoft.com/en-us/library/system.net.webclient.getwebrequest%28v=vs.110%29.aspx[^].

I hope, there is nothing else to discuss.

—SA
 
Share this answer
 
Comments
Praveen_P 9-May-15 1:11am    
hi thanks for your solution , actually i am working on a web applictaion in which when i call a soap webservice more than once i am getting error "Request aborted request cancelled" .i can solve this error in a asp.net website by overriding WebRequest GetWebRequest(Uri uri) of reference.cs of that particular service but in the case of web application reference.cs is generated in ASP temporary file so i am not able to edit it , i need to set the keep alive property of http request to false to solve this error
Sergey Alexandrovich Kryukov 9-May-15 1:13am    
And what's the problem? This is not what you asked initially.
—SA
Praveen_P 9-May-15 2:35am    
plz check this question http://www.codeproject.com/Questions/900128/Setting-HttpWebRequest-Keep-Alive-property-false?arn=0

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900