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

  • Question

  • User-96023207 posted

    Hello,

    I'm using the POST method to send the request to the production server and in web response I got the remote server returned an error: (500) Internal Server Error.  I looked in the Even Viewer Application log in localhost and it shows the exception message: "The remote server returned an error: (500) Internal Server Error."  I posted the same issue in asp.net at http://forums.asp.net/t/1335692.aspx but no real solution for this issue yet.  I'm hoping anyone here knows or familiar with this issue can help me out with this.  Thanks and really appreciated!

    Exception information:

    Exception type: WebException

    Exception message: The remote server returned an error: (500) Internal Server 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 75:                 newStream.Close();     //close the stream
    Line 76:                 //Get web Response
    Line 77:                 WResponse = (HttpWebResponse)myRequest.GetResponse();
    Line 78:                 StreamReader sr = new StreamReader(WResponse.GetResponseStream(), Encoding.ASCII);
    Line 79:                 ReturnData = sr.ReadToEnd();

    Sunday, October 19, 2008 10:47 PM

Answers

  • User1064866747 posted
    looking at your error message first of all I would suggest you to recompile your whole application, make sure all the required dlls are there in bin folder when you recompile it.
    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, October 24, 2008 2:32 AM

All replies

  • User1073881637 posted

    Can you manually issue a web response and further troubleshoot the issue?  You can use Fiddler to help see what is happening.  Also, using wfetch can help manually issue a web request and see the response.  500 can be a few different things, usually a data type is where I would start or validating the input.

    Sunday, October 19, 2008 10:53 PM
  • User-96023207 posted

    Thanks Steve for your help, I used the Fidder to debug the issue and it showed that the request used a protocol that is not currently supported. How do I fix this?

    <big>Request Error (unsupported_protocol)</big>

    Sunday, October 19, 2008 11:29 PM
  • User1064866747 posted

    There are several reasons for 500 error. You may get this error message from your proxy server, also when your server send cookie with back response.
    What security mode you have used in your script ?

    Monday, October 20, 2008 12:20 AM
  • User-96023207 posted

    Thanks Gabriel for replying, 

    For the Internet Security,  I have "Medium" for security level

    For web appl. authorization mode, I have checked "Anonymous access, allow IIS control password, and Intergated windows authentication"

     I used the Fiddler to determine the  cause of the HTTP Proxy and found that there is "No Proxy-Authorization Header" is present in the Connect type and for the POST method, it shows that "Request Error (unsupported_protocol)". How do I solve this problem?  Thanks in advance

    Here is the return error from the Fiddler:

    Fiddler has detected a protocol violation in session #448.

    The Server did not return properly formatted HTTP Headers. HTTP headers

    should be terminated with CRLFCRLF. These were terminated with LFLF. 

    Here is my code for the POST method:

    ASCIIEncoding encoding = new ASCIIEncoding();

    postData += "?userID=" + xxx;

    postData += "&password=" + xxxxxxx; postData += "&data=" + xmldoc.InnerXml;

    data = encoding.GetBytes(postData); //url-encoded

    // Prepare web request...

    HttpWebResponse WResponse = null;HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://www.abc.com/data/Default.aspx");myRequest.Method = "POST";myRequest.ContentType = "application/x-www-form-urlencoded";

    myRequest.ContentLength = data.Length;

    Stream newStream = myRequest.GetRequestStream();

    // Send the data.

    newStream.Write(data, 0, data.Length);

    newStream.Close(); //close the stream

    //Get web Response

    WResponse = (HttpWebResponse)myRequest.GetResponse();  //Error: the remote server an error (500) Internal Server error

    Monday, October 20, 2008 1:26 AM
  • User1064866747 posted

    can you please post here the exact error message you received in event logs ?

    Wednesday, October 22, 2008 2:51 AM
  • User-96023207 posted

    Here is the error in the Event Viewer Application:

    Event Type: Warning
    Event Source: ASP.NET 2.0.50727.0
    Event Category: Web Event
    Event ID: 1310
    Date:  10/22/2008
    Time:  8:52:21 PM
    User:  N/A
    Computer: JH
    Description:
    Event code: 3007
    Event message: A compilation error has occurred.
    Event time: 10/22/2008 8:52:21 PM
    Event time (UTC): 10/23/2008 12:52:21 AM
    Event ID: 30f062e6868c42bb8810d3e21e08ee48
    Event sequence: 6
    Event occurrence: 1
    Event detail code: 0
     
    Application information:
        Application domain: /LM/w3svc/1/ROOT/HttpHandler1.3-1-128691967332968750
        Trust level: Full
        Application Virtual Path: /HttpHandler1.3
        Application Path: c:\inetpub\wwwroot\HttpHandler1.3\
        Machine name: JH
     
    Process information:
        Process ID: 2768
        Process name: aspnet_wp.exe
        Account name: JH\ASPNET
     
    Exception information:
        Exception type: HttpCompileException
        Exception message: c:\Inetpub\wwwroot\HttpHandler1.3\WebRequestPost.aspx.cs(25): error CS1002: ; expected
     
    Request information:
        Request URL: http://localhost/HttpHandler1.3/WebRequestPost.aspx
        Request path: /HttpHandler1.3/WebRequestPost.aspx
        User host address: 127.0.0.1
        User: 
        Is authenticated: False
        Authentication Type: 
        Thread account name: JH\ASPNET
     
    Thread information:
        Thread ID: 1
        Thread account name: JH\ASPNET
        Is impersonating: False
        Stack trace:    at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
       at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
       at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
       at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
       at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
       at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
       at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
       at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
       at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     
     
    Custom event details:

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    ========================

    Here is the error that shows in Fiddler - HTTP Debugging Proxy

    No Proxy-Authenticate Header is present.

    No WWW-Authenticate Header is present.

    HTTP/1.1 400 Bad Request

    Date: Thu, 23 Oct 2008 01:12:37 GMT

    Server: www4.ford.com 100

    Content-Length: 0

    Connection: close

    Content-Type: text/html; charset=ISO-8859-1

    Content-Language: en-US

    X-RE-Ref: 1 1547917471

    P3P: CP="IDC DSP LAW ADM DEV TAI PSA PSD IVA IVD CON HIS TEL OUR DEL SAM OTR IND OTC"

    Wednesday, October 22, 2008 9:23 PM
  • User1064866747 posted
    looking at your error message first of all I would suggest you to recompile your whole application, make sure all the required dlls are there in bin folder when you recompile it.
    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, October 24, 2008 2:32 AM