web Service项目文件一直用的没问题,突然今天出问题了:程序掉web Service接口没有反应了,但网页调接口是没问题的。
最后排查到原来是Web.config上的参数发生了变化,估计是我原先在调试WebService时修改的,后来没改回来。我对WebService是小白。
我错误的参数
<configuration>
<system.web>
<compilation targetFramework="4.7.2" />
<httpRuntime targetFramework="4.7.2" />
<webServices>
<protocols>
<add name="HttpSoap" />
<add name="HttpPost" />
<add name="HttpGet" />
<add name="Documentation" />
</protocols>
</webServices>
</system.web>
</configuration>
我正确的参数
<?xml version="1.0"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
https://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation targetFramework="4.0"/>
<pages validateRequest="false"/>
<httpRuntime requestValidationMode="2.0" />
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
</webServices>
</system.web>
</configuration>
搞这个花了半天时间,郁闷啊。