How can the error 'Client found response content type of 'text/html'.. be interpreted

后端 未结 9 1531
深忆病人
深忆病人 2020-12-18 17:54

I\'m using C# and connecting to a WebService via an auto-generated C# proxy object. The method I\'m calling can be long running, and sometimes times out. I get different err

9条回答
  •  误落风尘
    2020-12-18 18:32

    This is happening because there is an unhandled exception in your Web service, and the .NET runtime is spitting out its HTML yellow screen of death server error/exception dump page, instead of XML.

    Since the consumer of your Web service was expecting a text/xml header and instead got text/html, it throws that error.

    You should address the cause of your timeouts (perhaps a lengthy SQL query?).

    Also, checkout this blog post on Jeff Atwood's blog that explains implementing a global unhandled exception handler and using SOAP exceptions.

提交回复
热议问题