简体   繁体   English

ASP.NET Web服务返回html而不是执行函数

[英]ASP.NET web service returns html instead of executing function

One of our clients ran into a really bizarre error with an ASP.NET web service that we've written. 我们的一个客户遇到了一个我们编写的ASP.NET Web服务的异常怪异的错误。 It has worked fine for 2 weeks, but recently they get the following exception when calling it: 它已经运行了2周,但最近他们在调用它时收到以下异常:

[Client found response content type of 'text/html; [客户发现响应内容类型为'text / html; charset=utf-8', but expected 'text/xml'. charset = utf-8”,但预期为“ text / xml”。

However, for these types of errors the returned HTML usually has some kind of indication of the type of error, but in this case, the HTML is the web service start page itself, ie the one with all the methods that is shown when browsing to the web service through a browser. 但是,对于这些类型的错误,返回的HTML通常具有某种错误类型的指示,但是在这种情况下,HTML是Web服务起始页面本身,即浏览到以下目录时显示的所有方法的页面。通过浏览器访问Web服务。

The most common solutions I've found suggest debugging the web service, but since it is installed in our client's environment this is not possible. 我发现最常见的解决方案建议调试Web服务,但是由于它已安装在我们客户的环境中,因此这是不可能的。 There is also no information or indication of what the error is. 也没有任何信息或错误指示。

What could be causing the web service to return the summary page instead of an error page? 是什么导致Web服务返回摘要页面而不是错误页面?

事实证明,客户端已将其站点改为使用https,将Web服务的请求URL更改为https可以解决问题。

try making chnages as follows: go to Basic Setting in IIS web service application then set the Application Pool to DefaultAppPool. 尝试按以下方式进行更改:转到IIS Web服务应用程序中的“基本设置”,然后将“应用程序池”设置为DefaultAppPool。 also check attached image for reference to make changes in IIS web application setting. 还请检查附件图像以供参考,以更改IIS Web应用程序设置。

在此处输入图片说明

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

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