The remote server returned an error: (500) Internal Server Error.

When I remote access in website by application on window to extract data I have error :

The remote server returned an error: (500) Internal Server Error.

This is my code :

Dim PostData As String = _
            "__VIEWSTATE=" & tmpvs & _
            "&txtUserName=" & UserID & _
            "&txtPassword=" & PWord & _
            "&chkPersistant=1" & _
            "&btnSignIn=SignIn" '& _

        Dim Data() As Byte = encoding.GetBytes(PostData)

        Dim LoginReq As Net.HttpWebRequest = Net.WebRequest.Create(loginURL)
        With LoginReq
            .KeepAlive = False
            .Method = "POST"
            .AllowAutoRedirect = False
            .ContentType = "application/x-www-form-urlencoded"
            .Referer = "http://www1.abc.com.vn/sanotc.aspx"
            .ContentLength = Data.Length
            .CookieContainer = autCookie
        End With

        Dim SendReq As IO.Stream = LoginReq.GetRequestStream
        SendReq.Write(Data, 0, Data.Length)
        SendReq.Close()

        Dim LoginRes As HttpWebResponse = LoginReq.GetResponse() 'Error Happen
        autCookie.Add(LoginRes.Cookies)

Pls help me.

Thanks
0
qt_hitech
4/22/2007 3:06:35 PM
asp.net.web-forms 93655 articles. 3 followers. Follow

5 Replies
2621 Views

Similar Articles

[PageSpeed] 57

Do you have console access to the remote server? If so check the event log for the time of that error.

Also please report your code sample preseving the new lines. 


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
4/22/2007 4:45:21 PM

When I remote access in website by application on window to extract data I have error :

The remote server returned an error: (500) Internal Server Error.

This is my code :

Dim PostData As String =

 "&__VIEWSTATE=" & ViewState & _

"&txtUserName=" & UserID & _

"&txtPassword=" & PWord & _

"&chkPersistant=1" & _

"&btnSignIn=SignIn" '

Dim Data() As Byte = encoding.GetBytes(PostData)

Dim LoginReq As Net.HttpWebRequest = Net.WebRequest.Create(loginURL)

With LoginReq

    .KeepAlive = False

    .Method = "POST"

    .AllowAutoRedirect = False

    .ContentType = "application/x-www-form-urlencoded"

    .Referer = "http://www1.abc.com.vn/sanotc.aspx"

    .ContentLength = Data.Length

    .CookieContainer = autCookie

End With

 
Dim SendReq As IO.Stream = LoginReq.GetRequestStream

SendReq.Write(Data, 0, Data.Length)

SendReq.Close()

Dim LoginRes As HttpWebResponse = LoginReq.GetResponse() 'Error Happen autCookie.Add(LoginRes.Cookies)

 autCookie.Add(LoginRes.Cookies)

Pls help me. Thanks

0
qt_hitech
4/22/2007 5:34:26 PM

>>When I remote access in website by application on window to extract data I have error :

Are using "remote access" to describe opening a web page on the server? I was referring to console access (a logged-in session) so that you can look at the event logs. 


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
4/22/2007 5:40:00 PM

I can not console access to Server, so I can not check  the event log.

I wanto access any website do extract data. 

0
qt_hitech
4/22/2007 5:40:47 PM
Hi,

The logic of your code seems to be allright. The problem may be with the data you send to the remote server is of a wrong format that may cause an error on it.
For instance, may be the ViewState isn't valid so that an validation error occurs.

It's hard to tell exactly what's the exception without detail information.
0
Raymond
4/26/2007 6:19:30 AM
Reply:

Similar Artilces:

Web Service Error : The remote server returned an error: (500) Internal Server Error
Hi i am getting an error when trying a simple web service. if i run both the web service and the client .aspx page on the same server it works fine, But when i put it on a different server it doesnt work at all and gives me this error"System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at HttpUtils.HttpPost(String URI, String Parameters) in e:\Websites\C#\Live\CMS\Trunk\App_Code\siteFunctions\HttpUtils.cs:line 35"UserApi.asmx  [WebMethod] public string HelloName(string name) { ...

System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
I have written a web service and tested it and it works fine from the .asmx test page. However, when I attempt to call it with a post I get this error:  The remote server returned an error: (500) Internal Server Error. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.Source Error: Line 164: myStream.Close() ...

The remote server returned an error: (500) Internal Server Error
I have a VB.Net application where I am posting to an HTTP server that has a classic asp page and I am getting the following exception (it's throwing the exception on line 13).  Does anyone know how to troubleshoot this?  thanks  : <EXCEPTION> The remote server returned an error: (500) Internal Server Error </EXCEPTION> 1                            PostData = "externalID=" ID2 Dim strPath As ...

The remote server returned an error: (500) Internal Server Error
Hi  String strUrl = "http://catalogues.cataloguecentral.com.au/global/search/search.aspx?";              // Create a request using a URL that can receive a post.         WebRequest request = WebRequest.Create(strUrl);        // Set the Method property of the request to POST.        request.Method = "POST";        // Create POST data and convert it to a byte array. &...

he remote server returned an error: (500) Internal Server Error.
Hi, I would like to connect a webservice. But I don't want to use "add web reference" -------------------------------------------------------------------------------------------- string strSoapMessage = "<?xml version='1.0' encoding='UTF-8'?>" + "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"+ "<soap:Body>"+ "<GenerateSessionKey xmlns='http://www.artwork-systems.com/webway/sessions'>"+ "<login>test</login>"+ "<auth>test<...

remote server returned an error: (500) Internal Server Error.
Hi Frnds, I have Using HTTP Post Method ,Already create Webconfig fine(  <webServices>      <protocols>        <add name="HttpGet"/>        <add name="HttpPost"/>      </protocols>    </webServices> )But i got  remote server returned an error: (500) Internal Server Error. i am not using SOAP.. public void Post()        {      ...

The remote server returned an error: (500) Internal Server Error. #2
I am testing a utility program that loops through my localhost and pulls out all of the meta tag information and page titles.   After I do a recursive directory search and have all of the pages i convert the directory path's to urls and call the pages using the following code WebClient wc = new WebClient(uri); string page = wc.DownloadString(uri); This seems to work fine for the first few sites, however at a certain point i start getting (The remote server returned an error: (500) Internal Server Error.).  Nothing is wrong with the URI however it just seems to st...

The remote server returned an error: (500) Internal Server Error #2
Hello, I'm trying to send the request from site A to site B in localhost but get an error "The remote server returned an error: (500) Internal Server Error" in programatically.  The code below used to work for me and all of a certain it fails to send the request to site B (order site). The order site by itself is still up and running but when I try to send the request to this site in the code, it fails because of (500) Internal Server Error.  I also tried to restart the IIS but still doesn't work.  Does anyone knows why?  mReqUrl =...

The remote server returned an error: (500) Internal Server Error. #3
I am trying to access a web site using below snippet HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse webResponse = (HttpWebResponse)httpWebRequest.GetResponse(); This is occuring for particular web site and rest of the web site working fine.  Error:  The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() -532459699...  Also, i tried with below options 1. Adding Credential likeNetworkCredential networkCredential = new NetworkCredential("user name", "pwd", &qu...

Message="The remote server returned an error: (500) Internal Server Error."
 HI,when I try to call a simple web method with parameters using HTTP Post I am getting this error "Message="The remote server returned an error: (500) Internal Server Error.""  This My Web Method [WebMethod]        public string getDataWithParm1(string aaa)        {            string ss= "yytry";            ss =ss + " asdfg" ;            r...

How to solve:"The remote server returned an error: (500) Internal Server Error. "
 I am working On asp.net2.0(c#) In creating rss i used a user control by writing xml dynamically. It is working well in my personal server but in my client server it is producing error such that.. Server Error in '/GetReception' Application. The remote server returned an error: (500) Internal Server Error. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote server return...

Server Error: HTTP Error 500.19
I got the following error while trying to make a test WCF project on VistaServer Error HTTP Error 500.19 - Internal Server ErrorDescription: The requested page cannot be accessed because the related configuration data for the page is invalid. Error Code: 0x80070005 Notification: BeginRequest Module: IIS Web Core Requested URL: http://localhost:80/ProductsService/ProductsService.svc Physical Path: C:\Test\ProductsService\ProductsService\ProductsService.svc Logon User: Not yet determined Logon Method: Not yet determined Handler: Not yet determined Config Error: Cannot read configura...

Why does a simple select query in Microsoft Access return the error [Intersolv][ODBC SQL Server Driver][SQL Server]ct_results(): user api layer: internal client library error: Read from the server has
I have applied the information from support document 10447954 but that does not solve the problem. I am running a simple select query with one criteria from one table. Thanks. ...

Web resources about - The remote server returned an error: (500) Internal Server Error. - asp.net.web-forms

Energy returned on energy invested - Wikipedia, the free encyclopedia
The natural or original sources of energy are not usually included in the calculation of energy invested, only the human-applied sources. For ...

How Facebook Returned A/B Testing To Mobile Apps
When Facebook rewrote its mobile applications and converted them from custom Web stacks to native development stacks, it lost the ability to ...

Facebook temporarily reveals ‘returned value’ metric for ads
Some Facebook advertisers temporarily saw a new metric called “returned value” in their Ads Manager dashboard. Facebook says the metric was accidentally ...

The Night Steve Jobs returned to Apple, Dec 20, 1996 - a set on Flickr
Working late on a Friday on December 20th at Apple Computer as Mac OS Evangelist, my manager came rushing past my office door saying to come ...

Batista reveals why he returned to WWE - YouTube
The Animal talks about overcoming a broken back, his immersion in Jiu-Jitsu training, and his desire to capture the WWE World Heavyweight Championship. ...

Fugitive US businessman Zack Shahin returned to UAE, says spokesman
... a taser following his release. A fugitive American businessman who is facing multi-million dirham corruption charges in Dubai has been returned ...

Bender is back! Belair’s favourite robot returned - AdelaideNow Search Search
GOOD news, everyone! Bender the robot — possibly the coolest letterbox in the Adelaide Hills — has been returned just days after being stolen. ...

War memento returned: 'It was like him coming home'
The home-made memento, fashioned into the shape of Australia and fastened around Richard Moffat's wrist with a length of leather, could have ...

Australian diplomat returned from posting after husband charged over child-sex allegations
One of Australia's top diplomats has returned early from an overseas posting after her spouse was arrested and charged with child sex offences.&nbsp; ...

Perth student’s camera returned after five years on bottom of Prague river
IT took a Beatles lyric, an aquatics instructor and social media to return Chloe Hutson’s long-lost holiday photographs five years after her ...

Resources last updated: 1/14/2016 3:56:39 PM