500 internal server error at GetResponse()

后端 未结 8 1904
花落未央
花落未央 2020-12-08 10:37

I have a heavy traffic aspx page calling a web service upon every user`s request as follows.

string uri = \"Path.asmx\";
string soap = \"soap xml string\";

         


        
8条回答
  •  悲&欢浪女
    2020-12-08 11:06

    For me this error occurred because I had 2 web API actions that had the exact same signatures and both had the same verbs, HttpPost, what I did was change one of the verbs (the one used for updating) to PUT and the error was removed. The following in my catch statement helped in getting to the root of the problem:

    catch (WebException webex)
    {
                    WebResponse errResp = webex.Response;
                    using (Stream respStream = errResp.GetResponseStream())
                    {
                        StreamReader reader = new StreamReader(respStream);
                        string text = reader.ReadToEnd();
                    }
    }
    

提交回复
热议问题