473,548 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebRequest.GetR esponse() throwing exception (Internal Server error

Hello,

I am trying to get a response for an .aspx page in my current project (same
virtual directory) by using WebRequest.GetR esponse 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 exception.

What I am doing is getting the .aspx response, reading the stream, replacing
pre-determined tags with app data, and then sending the HTML as an email
body, but I only have problems getting the response. The other logic works
fine (based on experience with the other, working page).

I am trying to get the response from a page that has server label controls
whose text is set by the code-behind depending on the culture set in the web
app.

I'm quite confused as I thought I should be able to call
WebRequest.GetR esponse on any page that I can load manually in Internet
Explorer (which, in this case, is true).

Here is the code in question:

System.Net.WebR equest req = System.Net.WebR equest.Create(a pplicationRootU RL
+ ResponseEmailSo urceFileName);
req.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
System.Net.WebR esponse resp = req.GetResponse ();
The page's code-behind is:

public class ResponseEmailTe mplate : InitializedThre adCulturePage
{
private const string BaseResourceNam e = "ResponseEmailT emplate";

protected System.Web.UI.W ebControls.Labe l lblPartiesInvol ved;
protected System.Web.UI.W ebControls.Labe l lblAmountClaime d;
protected System.Web.UI.W ebControls.Labe l lblMatterNumber ;
protected System.Web.UI.W ebControls.Labe l lblRespondingLa wyer;
protected System.Web.UI.W ebControls.Labe l lblDescription;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
LocalizePage();
}

private void LocalizePage()
{
ResourceManager rsm = this.GetPageRes ourceManager(Ba seResourceName) ;

// Localize labels.
lblPartiesInvol ved.Text = rsm.GetString(" Label.PartiesIn volved");
lblAmountClaime d.Text = rsm.GetString(" Label.AmountCla imed");
lblMatterNumber .Text = rsm.GetString(" Label.MatterNum ber");
lblRespondingLa wyer.Text = rsm.GetString(" Label.Respondin gLawyer");
lblDescription. Text = rsm.GetString(" Label.Descripti on");
}

Nov 19 '05 #1
4 7219
Does the page depend on any sort of client header being sent to indicate
the locale?

You might want to compare what the browser is sending over HTTP versus your
program with a tool like Fiddler [1]. These problems usually come down to
different headers or POST values.

[1] http://www.fiddlertool.com/fiddler/

--
Scott
http://www.OdeToCode.com/blogs/scott/
Hello,

I am trying to get a response for an .aspx page in my current project
(same virtual directory) by using WebRequest.GetR esponse 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 exception.

What I am doing is getting the .aspx response, reading the stream,
replacing pre-determined tags with app data, and then sending the HTML
as an email body, but I only have problems getting the response. The
other logic works fine (based on experience with the other, working
page).

I am trying to get the response from a page that has server label
controls whose text is set by the code-behind depending on the culture
set in the web app.

I'm quite confused as I thought I should be able to call
WebRequest.GetR esponse on any page that I can load manually in
Internet Explorer (which, in this case, is true).

Here is the code in question:

System.Net.WebR equest req =
System.Net.WebR equest.Create(a pplicationRootU RL
+ ResponseEmailSo urceFileName);
req.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
System.Net.WebR esponse resp = req.GetResponse ();
The page's code-behind is:

public class ResponseEmailTe mplate : InitializedThre adCulturePage
{
private const string BaseResourceNam e = "ResponseEmailT emplate";
protected System.Web.UI.W ebControls.Labe l lblPartiesInvol ved;
protected System.Web.UI.W ebControls.Labe l lblAmountClaime d;
protected System.Web.UI.W ebControls.Labe l lblMatterNumber ;
protected System.Web.UI.W ebControls.Labe l lblRespondingLa wyer;
protected System.Web.UI.W ebControls.Labe l lblDescription;
private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
LocalizePage();
}
private void LocalizePage()
{
ResourceManager rsm =
this.GetPageRes ourceManager(Ba seResourceName) ;
// Localize labels.
lblPartiesInvol ved.Text = rsm.GetString(" Label.PartiesIn volved");
lblAmountClaime d.Text = rsm.GetString(" Label.AmountCla imed");
lblMatterNumber .Text = rsm.GetString(" Label.MatterNum ber");
lblRespondingLa wyer.Text = rsm.GetString(" Label.Respondin gLawyer");
lblDescription. Text = rsm.GetString(" Label.Descripti on");
}

Nov 19 '05 #2
THANK YOU! That's a great little tool!

Now, I am running into an issue trying to use it with VS.NET 2003. When I
debug the web app and get a couple levels deep in the navigation, I get an
error saying that I have too many connections to the web server. (HTTP 403.9
- Access Forbidden: Too many users are connected Internet Information
Services). Sometimes I get an error directly from Fiddler about too many
socket connections as well. I found mention of this on the Fiddler forum
here: http://www.bayden.com/bbs/viewtopic.php?t=253

I have a corporate ISA proxy that requires NTLM authentication. I am using
Fiddler's "Require Authentication" , but after reading the forums, it looks as
though I won't be able to use Fiddler because of NTLM authentication hop
limitations. Is this correct?

I tried the setting suggested on the blog
(System.Net.Glo balProxySelecti on.Select = new
System.Net.WebP roxy("127.0.0.1 ", 8888);) but Fiddler never seems to catch any
requests when I'm debugging in VS.NET (although the request goes through just
fine. I did see mention of this in the forum as well).

Anyway, in all of my messing around with Fiddler, I was able to pinpoint the
problem as the proxy settings in my WebRequest.

Thanks again for the tool suggestion!

"Scott Allen" wrote:
Does the page depend on any sort of client header being sent to indicate
the locale?

You might want to compare what the browser is sending over HTTP versus your
program with a tool like Fiddler [1]. These problems usually come down to
different headers or POST values.

[1] http://www.fiddlertool.com/fiddler/

--
Scott
http://www.OdeToCode.com/blogs/scott/
Hello,

I am trying to get a response for an .aspx page in my current project
(same virtual directory) by using WebRequest.GetR esponse 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 exception.

What I am doing is getting the .aspx response, reading the stream,
replacing pre-determined tags with app data, and then sending the HTML
as an email body, but I only have problems getting the response. The
other logic works fine (based on experience with the other, working
page).

I am trying to get the response from a page that has server label
controls whose text is set by the code-behind depending on the culture
set in the web app.

I'm quite confused as I thought I should be able to call
WebRequest.GetR esponse on any page that I can load manually in
Internet Explorer (which, in this case, is true).

Here is the code in question:

System.Net.WebR equest req =
System.Net.WebR equest.Create(a pplicationRootU RL
+ ResponseEmailSo urceFileName);
req.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
System.Net.WebR esponse resp = req.GetResponse ();
The page's code-behind is:

public class ResponseEmailTe mplate : InitializedThre adCulturePage
{
private const string BaseResourceNam e = "ResponseEmailT emplate";
protected System.Web.UI.W ebControls.Labe l lblPartiesInvol ved;
protected System.Web.UI.W ebControls.Labe l lblAmountClaime d;
protected System.Web.UI.W ebControls.Labe l lblMatterNumber ;
protected System.Web.UI.W ebControls.Labe l lblRespondingLa wyer;
protected System.Web.UI.W ebControls.Labe l lblDescription;
private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
LocalizePage();
}
private void LocalizePage()
{
ResourceManager rsm =
this.GetPageRes ourceManager(Ba seResourceName) ;
// Localize labels.
lblPartiesInvol ved.Text = rsm.GetString(" Label.PartiesIn volved");
lblAmountClaime d.Text = rsm.GetString(" Label.AmountCla imed");
lblMatterNumber .Text = rsm.GetString(" Label.MatterNum ber");
lblRespondingLa wyer.Text = rsm.GetString(" Label.Respondin gLawyer");
lblDescription. Text = rsm.GetString(" Label.Descripti on");
}


Nov 19 '05 #3
I thought I'd post an update on my issue. It turns out that my problem had
nothing to do with the proxy settings.

I inherit my aspx page from a base class of type
"InitializedThr eadCulturePage" . This is a class (derived from
System.Web.UI.P age) that sets up the Thread Culture settings depending on a
user language choice (stored in a cookie).

I tried my code with a brand new "WebForm1.a spx" with no code in the
code-behind and had no problems. The next thing I tried was to inherit this
new WebForm1 from "InitializedThr eadCulturePage" and I received the 500
response code.

Here is the page code:

using System;
using System.Resource s;

namespace MyPage.Web.UI
{
/// <summary>
/// Base class for other pages in this application that require the
/// CultureInfo to be set on the current thread. Pages should
/// inherit from this class if they require this functionality.
///
/// This class also provides a method to retrieve the ResourceManager
/// for a particular page. In order to use this functionality, users
/// must create a resource file with the same filename as the web page,
/// minus the .aspx extension. Thus, if a page is named WebForm.aspx,
/// the user would create a file in the Resources folder called
/// WebForm.resx. Then, when you call the GetPageResource Manager
/// method, simply pass in the name WebForm in order to get the
/// appropriate resource set.
/// </summary>
public class InitializedThre adCulturePage : System.Web.UI.P age
{
private ResourceManager m_pageResourceM anager;

/// <summary>
/// Constructor that adds an event handler for the page's Load
/// event. The event handler will initialize the current thread's
/// CultureInfo appropriately.
/// </summary>
public InitializedThre adCulturePage()
{
this.Load += new System.EventHan dler(this.Page_ Load);
}

/// <summary>
/// Returns the page's resource manager. The baseName parameter
/// should match the name of the resource file in the Resources
/// directory. That is, if a resource exists named WebForm.resx,
/// the parameter supplied should be "WebForm".
/// </summary>
/// <remarks>
/// This method assumes that all resources are stored in satellite
/// assemblies with the neutral resources residing in the currently
/// executing assembly. Also, this method assumes that all resource
/// files are placed in the Resources directory before compilation.
/// </remarks>
/// <param name="baseName" >
/// The name of the resource set to retrieve. This name will match
/// the name of the resource file in the Resources directory.
/// </param>
/// <returns>
/// A ResourceManager object containing the specified resource set.
/// </returns>
protected ResourceManager GetPageResource Manager(string baseName)
{
if (m_pageResource Manager == null)
{
m_pageResourceM anager = new ResourceManager (
"MyPage.Web.UI. Resources." + baseName,
System.Reflecti on.Assembly.Get ExecutingAssemb ly());
}

return m_pageResourceM anager;
}

// This event handler will initialize the current thread's CultureInfo
// by looking for a cookie in the page that specifies the desired locale.
// If this cookie exists, the CultureInfo will be created using that
// locale. If not, then this event handler will retrieve the locale
// specified by in the HTTP header and use that to create the CultureInfo
// object.
// As a side effect, if a cookie exists, the cookie's expiration date
// will be reset.
private void Page_Load(objec t sender, System.EventArg s e)
{
System.Web.Http Cookie languageCookie =
Request.Cookies[WebConstants.Se lectedLanguageP arameterName];

string locale = Request.UserLan guages[0];
if (languageCookie != null)
{
locale = languageCookie. Value;

// Update the expiry date on the cookie.
languageCookie. Expires =
DateTime.Now.Ad dYears(WebConst ants.CookieExpi rationLength);
}

// Set the culture info for the current thread.
System.Threadin g.Thread.Curren tThread.Current UICulture =
System.Threadin g.Thread.Curren tThread.Current Culture =
System.Globaliz ation.CultureIn fo.CreateSpecif icCulture(local e);

if (languageCookie != null)
{
Response.Cookie s.Add(languageC ookie);
}
}
}
}

Any ideas as to why this doesn't work when creating a WebRequest
programmaticall y?

Thanks in advance.

"Terry" wrote:
THANK YOU! That's a great little tool!

Now, I am running into an issue trying to use it with VS.NET 2003. When I
debug the web app and get a couple levels deep in the navigation, I get an
error saying that I have too many connections to the web server. (HTTP 403.9
- Access Forbidden: Too many users are connected Internet Information
Services). Sometimes I get an error directly from Fiddler about too many
socket connections as well. I found mention of this on the Fiddler forum
here: http://www.bayden.com/bbs/viewtopic.php?t=253

I have a corporate ISA proxy that requires NTLM authentication. I am using
Fiddler's "Require Authentication" , but after reading the forums, it looks as
though I won't be able to use Fiddler because of NTLM authentication hop
limitations. Is this correct?

I tried the setting suggested on the blog
(System.Net.Glo balProxySelecti on.Select = new
System.Net.WebP roxy("127.0.0.1 ", 8888);) but Fiddler never seems to catch any
requests when I'm debugging in VS.NET (although the request goes through just
fine. I did see mention of this in the forum as well).

Anyway, in all of my messing around with Fiddler, I was able to pinpoint the
problem as the proxy settings in my WebRequest.

Thanks again for the tool suggestion!

"Scott Allen" wrote:
Does the page depend on any sort of client header being sent to indicate
the locale?

You might want to compare what the browser is sending over HTTP versus your
program with a tool like Fiddler [1]. These problems usually come down to
different headers or POST values.

[1] http://www.fiddlertool.com/fiddler/

--
Scott
http://www.OdeToCode.com/blogs/scott/
Hello,

I am trying to get a response for an .aspx page in my current project
(same virtual directory) by using WebRequest.GetR esponse 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 exception.

What I am doing is getting the .aspx response, reading the stream,
replacing pre-determined tags with app data, and then sending the HTML
as an email body, but I only have problems getting the response. The
other logic works fine (based on experience with the other, working
page).

I am trying to get the response from a page that has server label
controls whose text is set by the code-behind depending on the culture
set in the web app.

I'm quite confused as I thought I should be able to call
WebRequest.GetR esponse on any page that I can load manually in
Internet Explorer (which, in this case, is true).

Here is the code in question:

System.Net.WebR equest req =
System.Net.WebR equest.Create(a pplicationRootU RL
+ ResponseEmailSo urceFileName);
req.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
System.Net.WebR esponse resp = req.GetResponse ();
The page's code-behind is:

public class ResponseEmailTe mplate : InitializedThre adCulturePage
{
private const string BaseResourceNam e = "ResponseEmailT emplate";
protected System.Web.UI.W ebControls.Labe l lblPartiesInvol ved;
protected System.Web.UI.W ebControls.Labe l lblAmountClaime d;
protected System.Web.UI.W ebControls.Labe l lblMatterNumber ;
protected System.Web.UI.W ebControls.Labe l lblRespondingLa wyer;
protected System.Web.UI.W ebControls.Labe l lblDescription;
private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
LocalizePage();
}
private void LocalizePage()
{
ResourceManager rsm =
this.GetPageRes ourceManager(Ba seResourceName) ;
// Localize labels.
lblPartiesInvol ved.Text = rsm.GetString(" Label.PartiesIn volved");
lblAmountClaime d.Text = rsm.GetString(" Label.AmountCla imed");
lblMatterNumber .Text = rsm.GetString(" Label.MatterNum ber");
lblRespondingLa wyer.Text = rsm.GetString(" Label.Respondin gLawyer");
lblDescription. Text = rsm.GetString(" Label.Descripti on");
}


Nov 19 '05 #4
I doubt anyone is even still noticing this thread, but, for the sake of
consistency, I thought I'd share the solution to the problem that I was
having.

It turns out that the base class on which I was deriving all of my other
pages threw an exception in the Page_Load when trying to access
Request.UserLan guages[0]. This presented itself only when programmaticall y
requesting a page because this property was null.

Simple as that. No proxy issues, just poor code. :)

"Terry" wrote:
I thought I'd post an update on my issue. It turns out that my problem had
nothing to do with the proxy settings.

I inherit my aspx page from a base class of type
"InitializedThr eadCulturePage" . This is a class (derived from
System.Web.UI.P age) that sets up the Thread Culture settings depending on a
user language choice (stored in a cookie).

I tried my code with a brand new "WebForm1.a spx" with no code in the
code-behind and had no problems. The next thing I tried was to inherit this
new WebForm1 from "InitializedThr eadCulturePage" and I received the 500
response code.

Here is the page code:

using System;
using System.Resource s;

namespace MyPage.Web.UI
{
/// <summary>
/// Base class for other pages in this application that require the
/// CultureInfo to be set on the current thread. Pages should
/// inherit from this class if they require this functionality.
///
/// This class also provides a method to retrieve the ResourceManager
/// for a particular page. In order to use this functionality, users
/// must create a resource file with the same filename as the web page,
/// minus the .aspx extension. Thus, if a page is named WebForm.aspx,
/// the user would create a file in the Resources folder called
/// WebForm.resx. Then, when you call the GetPageResource Manager
/// method, simply pass in the name WebForm in order to get the
/// appropriate resource set.
/// </summary>
public class InitializedThre adCulturePage : System.Web.UI.P age
{
private ResourceManager m_pageResourceM anager;

/// <summary>
/// Constructor that adds an event handler for the page's Load
/// event. The event handler will initialize the current thread's
/// CultureInfo appropriately.
/// </summary>
public InitializedThre adCulturePage()
{
this.Load += new System.EventHan dler(this.Page_ Load);
}

/// <summary>
/// Returns the page's resource manager. The baseName parameter
/// should match the name of the resource file in the Resources
/// directory. That is, if a resource exists named WebForm.resx,
/// the parameter supplied should be "WebForm".
/// </summary>
/// <remarks>
/// This method assumes that all resources are stored in satellite
/// assemblies with the neutral resources residing in the currently
/// executing assembly. Also, this method assumes that all resource
/// files are placed in the Resources directory before compilation.
/// </remarks>
/// <param name="baseName" >
/// The name of the resource set to retrieve. This name will match
/// the name of the resource file in the Resources directory.
/// </param>
/// <returns>
/// A ResourceManager object containing the specified resource set.
/// </returns>
protected ResourceManager GetPageResource Manager(string baseName)
{
if (m_pageResource Manager == null)
{
m_pageResourceM anager = new ResourceManager (
"MyPage.Web.UI. Resources." + baseName,
System.Reflecti on.Assembly.Get ExecutingAssemb ly());
}

return m_pageResourceM anager;
}

// This event handler will initialize the current thread's CultureInfo
// by looking for a cookie in the page that specifies the desired locale.
// If this cookie exists, the CultureInfo will be created using that
// locale. If not, then this event handler will retrieve the locale
// specified by in the HTTP header and use that to create the CultureInfo
// object.
// As a side effect, if a cookie exists, the cookie's expiration date
// will be reset.
private void Page_Load(objec t sender, System.EventArg s e)
{
System.Web.Http Cookie languageCookie =
Request.Cookies[WebConstants.Se lectedLanguageP arameterName];

string locale = Request.UserLan guages[0];
if (languageCookie != null)
{
locale = languageCookie. Value;

// Update the expiry date on the cookie.
languageCookie. Expires =
DateTime.Now.Ad dYears(WebConst ants.CookieExpi rationLength);
}

// Set the culture info for the current thread.
System.Threadin g.Thread.Curren tThread.Current UICulture =
System.Threadin g.Thread.Curren tThread.Current Culture =
System.Globaliz ation.CultureIn fo.CreateSpecif icCulture(local e);

if (languageCookie != null)
{
Response.Cookie s.Add(languageC ookie);
}
}
}
}

Any ideas as to why this doesn't work when creating a WebRequest
programmaticall y?

Thanks in advance.

"Terry" wrote:
THANK YOU! That's a great little tool!

Now, I am running into an issue trying to use it with VS.NET 2003. When I
debug the web app and get a couple levels deep in the navigation, I get an
error saying that I have too many connections to the web server. (HTTP 403.9
- Access Forbidden: Too many users are connected Internet Information
Services). Sometimes I get an error directly from Fiddler about too many
socket connections as well. I found mention of this on the Fiddler forum
here: http://www.bayden.com/bbs/viewtopic.php?t=253

I have a corporate ISA proxy that requires NTLM authentication. I am using
Fiddler's "Require Authentication" , but after reading the forums, it looks as
though I won't be able to use Fiddler because of NTLM authentication hop
limitations. Is this correct?

I tried the setting suggested on the blog
(System.Net.Glo balProxySelecti on.Select = new
System.Net.WebP roxy("127.0.0.1 ", 8888);) but Fiddler never seems to catch any
requests when I'm debugging in VS.NET (although the request goes through just
fine. I did see mention of this in the forum as well).

Anyway, in all of my messing around with Fiddler, I was able to pinpoint the
problem as the proxy settings in my WebRequest.

Thanks again for the tool suggestion!

"Scott Allen" wrote:
Does the page depend on any sort of client header being sent to indicate
the locale?

You might want to compare what the browser is sending over HTTP versus your
program with a tool like Fiddler [1]. These problems usually come down to
different headers or POST values.

[1] http://www.fiddlertool.com/fiddler/

--
Scott
http://www.OdeToCode.com/blogs/scott/

> Hello,
>
> I am trying to get a response for an .aspx page in my current project
> (same virtual directory) by using WebRequest.GetR esponse 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 exception.
>
> What I am doing is getting the .aspx response, reading the stream,
> replacing pre-determined tags with app data, and then sending the HTML
> as an email body, but I only have problems getting the response. The
> other logic works fine (based on experience with the other, working
> page).
>
> I am trying to get the response from a page that has server label
> controls whose text is set by the code-behind depending on the culture
> set in the web app.
>
> I'm quite confused as I thought I should be able to call
> WebRequest.GetR esponse on any page that I can load manually in
> Internet Explorer (which, in this case, is true).
>
> Here is the code in question:
>
> System.Net.WebR equest req =
> System.Net.WebR equest.Create(a pplicationRootU RL
> + ResponseEmailSo urceFileName);
> req.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
> System.Net.WebR esponse resp = req.GetResponse ();
> The page's code-behind is:
>
> public class ResponseEmailTe mplate : InitializedThre adCulturePage
> {
> private const string BaseResourceNam e = "ResponseEmailT emplate";
> protected System.Web.UI.W ebControls.Labe l lblPartiesInvol ved;
> protected System.Web.UI.W ebControls.Labe l lblAmountClaime d;
> protected System.Web.UI.W ebControls.Labe l lblMatterNumber ;
> protected System.Web.UI.W ebControls.Labe l lblRespondingLa wyer;
> protected System.Web.UI.W ebControls.Labe l lblDescription;
> private void Page_Load(objec t sender, System.EventArg s e)
> {
> // Put user code to initialize the page here
> LocalizePage();
> }
> private void LocalizePage()
> {
> ResourceManager rsm =
> this.GetPageRes ourceManager(Ba seResourceName) ;
> // Localize labels.
> lblPartiesInvol ved.Text = rsm.GetString(" Label.PartiesIn volved");
> lblAmountClaime d.Text = rsm.GetString(" Label.AmountCla imed");
> lblMatterNumber .Text = rsm.GetString(" Label.MatterNum ber");
> lblRespondingLa wyer.Text = rsm.GetString(" Label.Respondin gLawyer");
> lblDescription. Text = rsm.GetString(" Label.Descripti on");
> }

Nov 19 '05 #5

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
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...
1
3214
by: William F. Robertson, Jr. | last post by:
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...
8
2388
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...
1
1505
by: Thomas Geisel | last post by:
Hi Everybody, after a while, i´ve had to maintain a ASP.NET/C# project, where during processing of an request, the same (local!) webserver is requested again for the response of a corresponding aspx-page. Something like this: .... string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
12
2851
by: ThyRock | last post by:
I am working on a WebRequest accessing the US Postal Service WebTools test API. This service uses a DLL file (ShippingAPITest.dll) with a query string which includes XML. The web service accepts the query string with no url encoding. I must pass the <> characters as they are in the query string. If these characters are url encoded the service...
0
3863
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...
0
1198
by: tascien | last post by:
Hi guys, when i use winhttp, and the server returns status 500, I get the text that the server returned anyway... when i use webrequest, and the server returns status 500, webrequest just throws an exception... How can i find the text that came back with the 500 status? I need this because i am posting to a web service, that returns...
1
4686
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
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7444
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
7711
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
7954
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
7467
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
6039
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
5367
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...
1
1932
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
755
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.