473,569 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebRequest GetResponse getting Internal Server Error

I am having problems with using the WebRequest object (or HttpWebRequest ).

I have created the WebRequest and set the credentials, but when I call
GetResponse() it is throwing an internal server error 500 on me.

I am running a console app on my sql server that is trying to create a
WebRequest to my Webserver to notify the cache on the webserver to refresh
itself.

The website is using NT authentication. The user I am using is in the Admin
group on the webserver and can access through the network (KB article said
to check that)

<code>
HttpWebRequest request = ( HttpWebRequest ) WebRequest.Crea te(
"http://server/page.aspx?Cache name=" + args[0] );
request.PreAuth enticate = true;
request.Credent ials = new NetworkCredenti al( "user", "pass", "domain" );

request.GetResp onse(); // throws exception.
</code>

Any ideas? Anything more I can do?

Thanks,

bill

Nov 18 '05 #1
1 3214

Hi Bill,

i had the same issue. webrequest has an error hadling class
webexception which you can use to get the html of the page and read th
500 erro

--
jimgseriou
-----------------------------------------------------------------------
jimgserious's Profile: http://www.highdots.com/forums/member.php?userid=46
View this thread: http://www.highdots.com/forums/showthread.php?t=64110

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3698
by: Sean Erwin | last post by:
I am having a very frustrating intermittent problem. I am making an A2A call to a remote server and when I issue the: WebRequest.getResponse call it occasionally fails with the following error: <Error description> Exception Type: System.Net.WebException Status: ConnectFailure Response: NULL
3
1681
by: Adam Stirk | last post by:
Hi, I am trying to download a image that is generated by PHP using HttpWebRequest, I believe the server uses cookies to generate the image, but I keep getting the error image from the server. Can anyone help? The code I am using is :-
0
1747
by: Marcus | last post by:
Hi all, I have some code that downloads an XML tree from a web server. If there is a problem returning the requested XML tree from the server, it returns an XML tree with the error message in a 500 internal server error response. I want to get this error message, but WebRequest.GetResponse() throws an error because of the server error, so I...
8
2389
by: John K. | last post by:
Hi I was wondering if it's possible to use the WebRequest class to access a file on windows shared folder with authentication? If yes, what would the syntax be? I've tried to look this up in the references available but to no avail Also, is it safer (better practise) in an LAN environment to use HTTP requests to access shared files (via...
4
7221
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server error" in the exception message. I am able to do this fine with another .aspx page that has no code-behind. The page that has code-behind throws the...
0
3866
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use tools like ieHTTPHeaders v1.6, and I perform a normal login (using the normal website), I see that the viewstate is...
3
3357
by: Mange | last post by:
I'm using WebRequest class to access a PHP script, but keep getting a 400 error from the server when calling the GetResponse() method. I have added the url to the script in the bypass list in machine.config to bypass the proxy server for this request, so it should not be a proxy issue. Also, I tried to run the same code in a Windows app, to...
5
10837
by: archana | last post by:
Hi all, I am having application which is validating URL's and checking whether that URL is redirecting to some other URL at a time of opening or not. My code looks like:- WebRequest myWebRequest = WebRequest.Create(textBox1.Text); response. myWebResponse = myWebRequest.GetResponse(); MssageBox.Show(myWebResponse.ResponseUri.ToString());
1
4688
by: mfreeman | last post by:
I have a VB.NET 2005 Windows application that worked fine when I ran it a month ago, and now it is throwing an exception ("The remote server returned an error: (500) Internal Server Error.") and I don't know why. The application screen scrapes a web page. If I paste the URL in my browser's address bar and the expected page comes up just...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.