472,791 Members | 1,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 software developers and data experts.

HttpWeb Request from Class Library fails to 500

Hi I have a class library that needs to download the HTML in a specific page
of ours with provided querystring.
When I open this URL with any browser, it loads fine. When I do WebRequest
from Web Project it is again fine.
However whenever I do this request from this class library, it fails.

I put every kind of user permission to the actual folder, and through
inetmgr. Right now everyone has full control.
But still I got the problem.

Code is as follows:
************************************************** ********************************
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(theFullUrl);
myRequest .UserAgent = "Fareportal .NET Request 1.1";
HttpWebResponse myResponse = (HttpWebResponse)myRequest .GetResponse();

IIS Log is as follows:
************************************************** ********************************
2006-01-05 21:14:39 W3SVC1 AHMET-IPC 192.168.0.163 GET /sevket3/Default.aspx
tabid=1076&guid=cd709879-6680-4cf7-bb98-2bb85b003f7d 80 - 192.168.0.163
HTTP/1.1 Fareportal+.NET+Request+1.1 - 192.168.0.163 500 0 0

Exception is as follows:
************************************************** ********************************
System.Net.WebException: The remote server returned an error: (500) Internal
Server Error.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
Platform:
ASP.NET 1.1
Win 2K3

I also have .NET 2.0 on this machine but this app is on 1.1
--

Thanks in advance,
SevDer
http://www.sevder.com

Jan 5 '06 #1
7 2456
Hello SevDer,
Hi I have a class library that needs to download the HTML in a
specific page
of ours with provided querystring.
When I open this URL with any browser, it loads fine. When I do
WebRequest
from Web Project it is again fine.
However whenever I do this request from this class library, it fails.
I put every kind of user permission to the actual folder, and through
inetmgr. Right now everyone has full control.
But still I got the problem.
Code is as follows:
************************************************** ********************
************
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create(theFullUrl);
myRequest .UserAgent = "Fareportal .NET Request 1.1";
HttpWebResponse myResponse = (HttpWebResponse)myRequest
.GetResponse();
IIS Log is as follows:
************************************************** ********************
************
2006-01-05 21:14:39 W3SVC1 AHMET-IPC 192.168.0.163 GET
/sevket3/Default.aspx
tabid=1076&guid=cd709879-6680-4cf7-bb98-2bb85b003f7d 80 -
192.168.0.163
HTTP/1.1 Fareportal+.NET+Request+1.1 - 192.168.0.163 500 0 0
Exception is as follows:
************************************************** ********************
************
System.Net.WebException: The remote server returned an error: (500)
Internal
Server Error.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
asyncResult)
at System.Net.HttpWebRequest.GetResponse()


It's a server-side error -- your ASP.NET app breaks. You should debug that
page.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jan 5 '06 #2
Hi SevDer,

I agree with Joerg , since the IIS server has received the request, it is
likely something at serverside (asp.net page) or our code logic cause the
problem. I've ever met some similiar problem which is caused by the user
agent not set correctly. Have you tried using the IE explorer's userAgent
string to see whether it works? Also, if convenient, I suggest you provide
some further detailed info on the asp.net page you request...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Message-ID: <94*************************@msnews.microsoft.co m>
| From: Joerg Jooss <ne********@joergjooss.de>
| Subject: Re: HttpWeb Request from Class Library fails to 500
| References: <#f**************@TK2MSFTNGP10.phx.gbl>
| MIME-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=_autodetect_all; format=flowed
| X-Newsreader: JetBrains Omea Reader 671.6
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Date: Thu, 05 Jan 2006 14:38:57 -0800
| NNTP-Posting-Host: p549616F2.dip0.t-ipconnect.de 84.150.22.242
| Lines: 1
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368915
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello SevDer,
|
| > Hi I have a class library that needs to download the HTML in a
| > specific page
| > of ours with provided querystring.
| > When I open this URL with any browser, it loads fine. When I do
| > WebRequest
| > from Web Project it is again fine.
| > However whenever I do this request from this class library, it fails.
| > I put every kind of user permission to the actual folder, and through
| > inetmgr. Right now everyone has full control.
| > But still I got the problem.
| > Code is as follows:
| > ************************************************** ********************
| > ************
| > HttpWebRequest myRequest =
| > (HttpWebRequest)WebRequest.Create(theFullUrl);
| > myRequest .UserAgent = "Fareportal .NET Request 1.1";
| > HttpWebResponse myResponse = (HttpWebResponse)myRequest
| > .GetResponse();
| > IIS Log is as follows:
| > ************************************************** ********************
| > ************
| > 2006-01-05 21:14:39 W3SVC1 AHMET-IPC 192.168.0.163 GET
| > /sevket3/Default.aspx
| > tabid=1076&guid=cd709879-6680-4cf7-bb98-2bb85b003f7d 80 -
| > 192.168.0.163
| > HTTP/1.1 Fareportal+.NET+Request+1.1 - 192.168.0.163 500 0 0
| > Exception is as follows:
| > ************************************************** ********************
| > ************
| > System.Net.WebException: The remote server returned an error: (500)
| > Internal
| > Server Error.
| > at System.Net.HttpWebRequest.CheckFinalStatus()
| > at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
| > asyncResult)
| > at System.Net.HttpWebRequest.GetResponse()
|
| It's a server-side error -- your ASP.NET app breaks. You should debug
that
| page.
|
| Cheers,
| --
| Joerg Jooss
| ne********@joergjooss.de

|
|

Jan 6 '06 #3
Hi Steven,

I also used IE UserAgent string. The result is the same.
This page itself is a simple page that displays some content based on the
querystring that you pass. And this is a page which is available to public
also on production enviorment.
And as I said, if I do the same code from web app, there is no problem, but
from the class library it is a problem.

Even more on this problem. I put same page's URL which is on production
enviorment and it worked fine. But when I try my local, it fails. I do not
understand what is wrong?

URL development = http://192.168.x.x/Default.asx?querystring FAILS
URL production = http://publicdomain.com/Default.aspx?querystring WORKS
FINE

And the test is done from my development platform, therefore I do not think
that the problem is on that page.
The only funny thing I am thinking is, the class which has this static
method that makes the webrequest call is being used in the page that I am
requesting but that page uses its own instance of this object and does not
do anything with this static method.

Do you have any idea why I may still have the problem?
Thanks in advance,
SevDer
http://www.sevder.com
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:2m**************@TK2MSFTNGXA02.phx.gbl...
Hi SevDer,

I agree with Joerg , since the IIS server has received the request, it is
likely something at serverside (asp.net page) or our code logic cause the
problem. I've ever met some similiar problem which is caused by the user
agent not set correctly. Have you tried using the IE explorer's userAgent
string to see whether it works? Also, if convenient, I suggest you provide
some further detailed info on the asp.net page you request...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Message-ID: <94*************************@msnews.microsoft.co m>
| From: Joerg Jooss <ne********@joergjooss.de>
| Subject: Re: HttpWeb Request from Class Library fails to 500
| References: <#f**************@TK2MSFTNGP10.phx.gbl>
| MIME-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=_autodetect_all; format=flowed
| X-Newsreader: JetBrains Omea Reader 671.6
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Date: Thu, 05 Jan 2006 14:38:57 -0800
| NNTP-Posting-Host: p549616F2.dip0.t-ipconnect.de 84.150.22.242
| Lines: 1
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368915
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello SevDer,
|
| > Hi I have a class library that needs to download the HTML in a
| > specific page
| > of ours with provided querystring.
| > When I open this URL with any browser, it loads fine. When I do
| > WebRequest
| > from Web Project it is again fine.
| > However whenever I do this request from this class library, it fails.
| > I put every kind of user permission to the actual folder, and through
| > inetmgr. Right now everyone has full control.
| > But still I got the problem.
| > Code is as follows:
| > ************************************************** ********************
| > ************
| > HttpWebRequest myRequest =
| > (HttpWebRequest)WebRequest.Create(theFullUrl);
| > myRequest .UserAgent = "Fareportal .NET Request 1.1";
| > HttpWebResponse myResponse = (HttpWebResponse)myRequest
| > .GetResponse();
| > IIS Log is as follows:
| > ************************************************** ********************
| > ************
| > 2006-01-05 21:14:39 W3SVC1 AHMET-IPC 192.168.0.163 GET
| > /sevket3/Default.aspx
| > tabid=1076&guid=cd709879-6680-4cf7-bb98-2bb85b003f7d 80 -
| > 192.168.0.163
| > HTTP/1.1 Fareportal+.NET+Request+1.1 - 192.168.0.163 500 0 0
| > Exception is as follows:
| > ************************************************** ********************
| > ************
| > System.Net.WebException: The remote server returned an error: (500)
| > Internal
| > Server Error.
| > at System.Net.HttpWebRequest.CheckFinalStatus()
| > at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
| > asyncResult)
| > at System.Net.HttpWebRequest.GetResponse()
|
| It's a server-side error -- your ASP.NET app breaks. You should debug
that
| page.
|
| Cheers,
| --
| Joerg Jooss
| ne********@joergjooss.de

|
|

Jan 6 '06 #4
Hi Steven,

I did some more progress in this.
I moved the static method to a different class say class "framework".

And I have 2 classes that acceses that static method as
"framework.GetHTMLContent(querystring)"
When I reach this method from one the classes say "classA" by providing
"querystringA", method works fine.
But when I reach this method from "classB" with exactly the same
"querystringA", it fails with 500.

Now in both cases
1. the URL that I am requesting is exactly the same
2. In both cases I have HttpContext.Current available.

So what may be the problem.

Bottom line is "framework.GetHTMLContent(querystring)" works when called
from 1 class but does not work from the other one with the same parameter.

I appreciate your help in this.
Regards,

SevDer
http://www.sevder.com
A new source for .NET Developers
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:2m**************@TK2MSFTNGXA02.phx.gbl...
Hi SevDer,

I agree with Joerg , since the IIS server has received the request, it is
likely something at serverside (asp.net page) or our code logic cause the
problem. I've ever met some similiar problem which is caused by the user
agent not set correctly. Have you tried using the IE explorer's userAgent
string to see whether it works? Also, if convenient, I suggest you provide
some further detailed info on the asp.net page you request...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Message-ID: <94*************************@msnews.microsoft.co m>
| From: Joerg Jooss <ne********@joergjooss.de>
| Subject: Re: HttpWeb Request from Class Library fails to 500
| References: <#f**************@TK2MSFTNGP10.phx.gbl>
| MIME-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=_autodetect_all; format=flowed
| X-Newsreader: JetBrains Omea Reader 671.6
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Date: Thu, 05 Jan 2006 14:38:57 -0800
| NNTP-Posting-Host: p549616F2.dip0.t-ipconnect.de 84.150.22.242
| Lines: 1
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368915
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello SevDer,
|
| > Hi I have a class library that needs to download the HTML in a
| > specific page
| > of ours with provided querystring.
| > When I open this URL with any browser, it loads fine. When I do
| > WebRequest
| > from Web Project it is again fine.
| > However whenever I do this request from this class library, it fails.
| > I put every kind of user permission to the actual folder, and through
| > inetmgr. Right now everyone has full control.
| > But still I got the problem.
| > Code is as follows:
| > ************************************************** ********************
| > ************
| > HttpWebRequest myRequest =
| > (HttpWebRequest)WebRequest.Create(theFullUrl);
| > myRequest .UserAgent = "Fareportal .NET Request 1.1";
| > HttpWebResponse myResponse = (HttpWebResponse)myRequest
| > .GetResponse();
| > IIS Log is as follows:
| > ************************************************** ********************
| > ************
| > 2006-01-05 21:14:39 W3SVC1 AHMET-IPC 192.168.0.163 GET
| > /sevket3/Default.aspx
| > tabid=1076&guid=cd709879-6680-4cf7-bb98-2bb85b003f7d 80 -
| > 192.168.0.163
| > HTTP/1.1 Fareportal+.NET+Request+1.1 - 192.168.0.163 500 0 0
| > Exception is as follows:
| > ************************************************** ********************
| > ************
| > System.Net.WebException: The remote server returned an error: (500)
| > Internal
| > Server Error.
| > at System.Net.HttpWebRequest.CheckFinalStatus()
| > at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
| > asyncResult)
| > at System.Net.HttpWebRequest.GetResponse()
|
| It's a server-side error -- your ASP.NET app breaks. You should debug
that
| page.
|
| Cheers,
| --
| Joerg Jooss
| ne********@joergjooss.de

|
|

Jan 6 '06 #5
Hi everyone, or who follows that thread.

I findout the problem.
In both classes I have a database transaction going on.
In class 1, I was committing the transaction and then trying to load the
content
In class 2, I was trying to load the content and then commit the
transaction.

As a result in class 2, the data is being held by the transaction so I was
not able to load it.

Sorry for the trouble.

--

SevDer
http://www.sevder.com
A new source for .NET Developers
"SevDer" <se****@newsgroup.nospam> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Steven,

I did some more progress in this.
I moved the static method to a different class say class "framework".

And I have 2 classes that acceses that static method as
"framework.GetHTMLContent(querystring)"
When I reach this method from one the classes say "classA" by providing
"querystringA", method works fine.
But when I reach this method from "classB" with exactly the same
"querystringA", it fails with 500.

Now in both cases
1. the URL that I am requesting is exactly the same
2. In both cases I have HttpContext.Current available.

So what may be the problem.

Bottom line is "framework.GetHTMLContent(querystring)" works when called
from 1 class but does not work from the other one with the same parameter.

I appreciate your help in this.
Regards,

SevDer
http://www.sevder.com
A new source for .NET Developers
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:2m**************@TK2MSFTNGXA02.phx.gbl...
Hi SevDer,

I agree with Joerg , since the IIS server has received the request, it is
likely something at serverside (asp.net page) or our code logic cause the
problem. I've ever met some similiar problem which is caused by the user
agent not set correctly. Have you tried using the IE explorer's userAgent
string to see whether it works? Also, if convenient, I suggest you
provide
some further detailed info on the asp.net page you request...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Message-ID: <94*************************@msnews.microsoft.co m>
| From: Joerg Jooss <ne********@joergjooss.de>
| Subject: Re: HttpWeb Request from Class Library fails to 500
| References: <#f**************@TK2MSFTNGP10.phx.gbl>
| MIME-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=_autodetect_all; format=flowed
| X-Newsreader: JetBrains Omea Reader 671.6
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Date: Thu, 05 Jan 2006 14:38:57 -0800
| NNTP-Posting-Host: p549616F2.dip0.t-ipconnect.de 84.150.22.242
| Lines: 1
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368915
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello SevDer,
|
| > Hi I have a class library that needs to download the HTML in a
| > specific page
| > of ours with provided querystring.
| > When I open this URL with any browser, it loads fine. When I do
| > WebRequest
| > from Web Project it is again fine.
| > However whenever I do this request from this class library, it fails.
| > I put every kind of user permission to the actual folder, and through
| > inetmgr. Right now everyone has full control.
| > But still I got the problem.
| > Code is as follows:
| >
************************************************** ********************
| > ************
| > HttpWebRequest myRequest =
| > (HttpWebRequest)WebRequest.Create(theFullUrl);
| > myRequest .UserAgent = "Fareportal .NET Request 1.1";
| > HttpWebResponse myResponse = (HttpWebResponse)myRequest
| > .GetResponse();
| > IIS Log is as follows:
| >
************************************************** ********************
| > ************
| > 2006-01-05 21:14:39 W3SVC1 AHMET-IPC 192.168.0.163 GET
| > /sevket3/Default.aspx
| > tabid=1076&guid=cd709879-6680-4cf7-bb98-2bb85b003f7d 80 -
| > 192.168.0.163
| > HTTP/1.1 Fareportal+.NET+Request+1.1 - 192.168.0.163 500 0 0
| > Exception is as follows:
| >
************************************************** ********************
| > ************
| > System.Net.WebException: The remote server returned an error: (500)
| > Internal
| > Server Error.
| > at System.Net.HttpWebRequest.CheckFinalStatus()
| > at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
| > asyncResult)
| > at System.Net.HttpWebRequest.GetResponse()
|
| It's a server-side error -- your ASP.NET app breaks. You should debug
that
| page.
|
| Cheers,
| --
| Joerg Jooss
| ne********@joergjooss.de

|
|


Jan 6 '06 #6
Hi everyone, or who follows that thread.

I findout the problem.
In both classes I have a database transaction going on.
In class 1, I was committing the transaction and then trying to load the
content
In class 2, I was trying to load the content and then commit the
transaction.

As a result in class 2, the data is being held by the transaction so I was
not able to load it.

Sorry for the trouble.

--

SevDer
http://www.sevder.com
A new source for .NET Developers
"SevDer" <se****@newsgroup.nospam> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Steven,

I did some more progress in this.
I moved the static method to a different class say class "framework".

And I have 2 classes that acceses that static method as
"framework.GetHTMLContent(querystring)"
When I reach this method from one the classes say "classA" by providing
"querystringA", method works fine.
But when I reach this method from "classB" with exactly the same
"querystringA", it fails with 500.

Now in both cases
1. the URL that I am requesting is exactly the same
2. In both cases I have HttpContext.Current available.

So what may be the problem.

Bottom line is "framework.GetHTMLContent(querystring)" works when called
from 1 class but does not work from the other one with the same parameter.

I appreciate your help in this.
Regards,

SevDer
http://www.sevder.com
A new source for .NET Developers
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:2m**************@TK2MSFTNGXA02.phx.gbl...
Hi SevDer,

I agree with Joerg , since the IIS server has received the request, it is
likely something at serverside (asp.net page) or our code logic cause the
problem. I've ever met some similiar problem which is caused by the user
agent not set correctly. Have you tried using the IE explorer's userAgent
string to see whether it works? Also, if convenient, I suggest you
provide
some further detailed info on the asp.net page you request...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Message-ID: <94*************************@msnews.microsoft.co m>
| From: Joerg Jooss <ne********@joergjooss.de>
| Subject: Re: HttpWeb Request from Class Library fails to 500
| References: <#f**************@TK2MSFTNGP10.phx.gbl>
| MIME-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=_autodetect_all; format=flowed
| X-Newsreader: JetBrains Omea Reader 671.6
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Date: Thu, 05 Jan 2006 14:38:57 -0800
| NNTP-Posting-Host: p549616F2.dip0.t-ipconnect.de 84.150.22.242
| Lines: 1
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:368915
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello SevDer,
|
| > Hi I have a class library that needs to download the HTML in a
| > specific page
| > of ours with provided querystring.
| > When I open this URL with any browser, it loads fine. When I do
| > WebRequest
| > from Web Project it is again fine.
| > However whenever I do this request from this class library, it fails.
| > I put every kind of user permission to the actual folder, and through
| > inetmgr. Right now everyone has full control.
| > But still I got the problem.
| > Code is as follows:
| >
************************************************** ********************
| > ************
| > HttpWebRequest myRequest =
| > (HttpWebRequest)WebRequest.Create(theFullUrl);
| > myRequest .UserAgent = "Fareportal .NET Request 1.1";
| > HttpWebResponse myResponse = (HttpWebResponse)myRequest
| > .GetResponse();
| > IIS Log is as follows:
| >
************************************************** ********************
| > ************
| > 2006-01-05 21:14:39 W3SVC1 AHMET-IPC 192.168.0.163 GET
| > /sevket3/Default.aspx
| > tabid=1076&guid=cd709879-6680-4cf7-bb98-2bb85b003f7d 80 -
| > 192.168.0.163
| > HTTP/1.1 Fareportal+.NET+Request+1.1 - 192.168.0.163 500 0 0
| > Exception is as follows:
| >
************************************************** ********************
| > ************
| > System.Net.WebException: The remote server returned an error: (500)
| > Internal
| > Server Error.
| > at System.Net.HttpWebRequest.CheckFinalStatus()
| > at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
| > asyncResult)
| > at System.Net.HttpWebRequest.GetResponse()
|
| It's a server-side error -- your ASP.NET app breaks. You should debug
that
| page.
|
| Cheers,
| --
| Joerg Jooss
| ne********@joergjooss.de

|
|



Jan 6 '06 #7
Thanks for your followup SevDer,

Glad that you've figured out the problem.

Have a good day!

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Reply-To: "SevDer" <se******@sevder.com>
| From: "SevDer" <se****@newsgroup.nospam>
| References: <#f**************@TK2MSFTNGP10.phx.gbl>
<94*************************@msnews.microsoft.co m>
<2m**************@TK2MSFTNGXA02.phx.gbl>
<#8**************@TK2MSFTNGP12.phx.gbl>
| Subject: Re: HttpWeb Request from Class Library fails to 500
| Date: Fri, 6 Jan 2006 12:31:02 -0500
| Lines: 152
| Organization: http://www.sevder.com
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| Message-ID: <ez**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: mail.dtfares.com 68.167.20.2
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:369080
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi everyone, or who follows that thread.
|
| I findout the problem.
| In both classes I have a database transaction going on.
| In class 1, I was committing the transaction and then trying to load the
| content
| In class 2, I was trying to load the content and then commit the
| transaction.
|
| As a result in class 2, the data is being held by the transaction so I
was
| not able to load it.
|
| Sorry for the trouble.
|
| --
|
| SevDer
| http://www.sevder.com
| A new source for .NET Developers
|
|
| "SevDer" <se****@newsgroup.nospam> wrote in message
| news:%2****************@TK2MSFTNGP12.phx.gbl...
| > Hi Steven,
| >
| > I did some more progress in this.
| > I moved the static method to a different class say class "framework".
| >
| > And I have 2 classes that acceses that static method as
| > "framework.GetHTMLContent(querystring)"
| > When I reach this method from one the classes say "classA" by providing
| > "querystringA", method works fine.
| > But when I reach this method from "classB" with exactly the same
| > "querystringA", it fails with 500.
| >
| > Now in both cases
| > 1. the URL that I am requesting is exactly the same
| > 2. In both cases I have HttpContext.Current available.
| >
| > So what may be the problem.
| >
| > Bottom line is "framework.GetHTMLContent(querystring)" works when
called
| > from 1 class but does not work from the other one with the same
parameter.
| >
| > I appreciate your help in this.
| > Regards,
| >
| > SevDer
| > http://www.sevder.com
| > A new source for .NET Developers
| >
| >
| > "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| > news:2m**************@TK2MSFTNGXA02.phx.gbl...
| >> Hi SevDer,
| >>
| >> I agree with Joerg , since the IIS server has received the request, it
is
| >> likely something at serverside (asp.net page) or our code logic cause
the
| >> problem. I've ever met some similiar problem which is caused by the
user
| >> agent not set correctly. Have you tried using the IE explorer's
userAgent
| >> string to see whether it works? Also, if convenient, I suggest you
| >> provide
| >> some further detailed info on the asp.net page you request...
| >>
| >> Thanks,
| >>
| >> Steven Cheng
| >> Microsoft Online Support
| >>
| >> Get Secure! www.microsoft.com/security
| >> (This posting is provided "AS IS", with no warranties, and confers no
| >> rights.)
| >>
| >>
| >>
| >>
| >> --------------------
| >> | Message-ID: <94*************************@msnews.microsoft.co m>
| >> | From: Joerg Jooss <ne********@joergjooss.de>
| >> | Subject: Re: HttpWeb Request from Class Library fails to 500
| >> | References: <#f**************@TK2MSFTNGP10.phx.gbl>
| >> | MIME-Version: 1.0
| >> | Content-Transfer-Encoding: 8bit
| >> | Content-Type: text/plain; charset=_autodetect_all; format=flowed
| >> | X-Newsreader: JetBrains Omea Reader 671.6
| >> | Newsgroups: microsoft.public.dotnet.framework.aspnet
| >> | Date: Thu, 05 Jan 2006 14:38:57 -0800
| >> | NNTP-Posting-Host: p549616F2.dip0.t-ipconnect.de 84.150.22.242
| >> | Lines: 1
| >> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| >> | Xref: TK2MSFTNGXA02.phx.gbl
| >> microsoft.public.dotnet.framework.aspnet:368915
| >> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| >> |
| >> | Hello SevDer,
| >> |
| >> | > Hi I have a class library that needs to download the HTML in a
| >> | > specific page
| >> | > of ours with provided querystring.
| >> | > When I open this URL with any browser, it loads fine. When I do
| >> | > WebRequest
| >> | > from Web Project it is again fine.
| >> | > However whenever I do this request from this class library, it
fails.
| >> | > I put every kind of user permission to the actual folder, and
through
| >> | > inetmgr. Right now everyone has full control.
| >> | > But still I got the problem.
| >> | > Code is as follows:
| >> | >
| >> ************************************************** ********************
| >> | > ************
| >> | > HttpWebRequest myRequest =
| >> | > (HttpWebRequest)WebRequest.Create(theFullUrl);
| >> | > myRequest .UserAgent = "Fareportal .NET Request 1.1";
| >> | > HttpWebResponse myResponse = (HttpWebResponse)myRequest
| >> | > .GetResponse();
| >> | > IIS Log is as follows:
| >> | >
| >> ************************************************** ********************
| >> | > ************
| >> | > 2006-01-05 21:14:39 W3SVC1 AHMET-IPC 192.168.0.163 GET
| >> | > /sevket3/Default.aspx
| >> | > tabid=1076&guid=cd709879-6680-4cf7-bb98-2bb85b003f7d 80 -
| >> | > 192.168.0.163
| >> | > HTTP/1.1 Fareportal+.NET+Request+1.1 - 192.168.0.163 500 0 0
| >> | > Exception is as follows:
| >> | >
| >> ************************************************** ********************
| >> | > ************
| >> | > System.Net.WebException: The remote server returned an error: (500)
| >> | > Internal
| >> | > Server Error.
| >> | > at System.Net.HttpWebRequest.CheckFinalStatus()
| >> | > at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
| >> | > asyncResult)
| >> | > at System.Net.HttpWebRequest.GetResponse()
| >> |
| >> | It's a server-side error -- your ASP.NET app breaks. You should debug
| >> that
| >> | page.
| >> |
| >> | Cheers,
| >> | --
| >> | Joerg Jooss
| >> | ne********@joergjooss.de
| >>
| >> |
| >> |
| >>
| >
| >
|
|
|

Jan 9 '06 #8

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

Similar topics

4
by: Zibi | last post by:
I try to use script from www.freeaspupload.net for upload file. I need to store in session object the names of uploaded files but I get an error - Cannot use Request.Form collection after...
28
by: Steven T. Hatton | last post by:
This may be another question having an obvious answer, but I'm not seeing it. I'm trying to create a class that derives from std::valarray<std::string>. I don't need a template, and I haven't come...
1
by: mt404 | last post by:
Hi, I was wondering if someone might be able to provide some guidance on how I could make an http request from a C# library. Basically I have a library which accepts a couple of arguments that...
8
by: Joe | last post by:
I have a web service which returns many types (classes) to match the return type. I want to cast the return type to the actual class type. For example: namespace Test { class MyClass { ...
3
by: ExclusiveResorts | last post by:
Can the CallContext be used reliably for storing request specific data? We are developing an application library that uses the CallContext to keep an IdentityMap (hashtable of business objects...
1
by: MauRos | last post by:
Hello, I need help using the httpweb request. I am getting an error when trying to read the source code from the following web page: ...
2
by: =?Utf-8?B?U2Fs?= | last post by:
<I MOVED THIS POST TO ITS OWN THREAD. ORIGINAL POST FOUND HERE:...
3
by: Med | last post by:
Hi, I use Visual C# Express 2005 and Visual Web Developer Express 2005. In my Visual C# Express 2005 Solution, I have following two class library projects: _ DataAccess (Namespace name:...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.