简体   繁体   English

HttpWebResponse处的500内部服务器错误

[英]500 Internal Server Error at HttpWebResponse

I have a few web services up and running fine on my localhost. 我有一些Web服务在我的本地主机上运行良好。 The problem is when I try requesting a response from it, the following error comes up when debugging: 问题是当我尝试从中请求响应时,调试时出现以下错误:

Web Exception was unhandled by user code
The remote server returned an error: (500) Internal Server Error

The piece of my code where it throws this error is at the HttpWebResponse header: 我的引发此错误的代码位于HttpWebResponse标头:

    using (HttpWebResponse httpResponse = httpRequest.GetResponse() as HttpWebResponse)
    {
        Encoding enc = Encoding.GetEncoding(1252);


        using (StreamReader responseStream = new StreamReader(httpResponse.GetResponseStream(), enc))
        {



           bl =  responseStream.ReadToEnd();
        }
    }

Any tips? 有小费吗? I'm sort of new to this...much appreciated. 我对此有些陌生...非常感谢。

The 500 error means something went wrong in the server side. 500错误表示服务器端出了点问题。

If you also wrote the web services, that's the code you have to inspect and debug. 如果您还编写了Web服务,那么这就是您必须检查和调试的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM