WCF服务错误:the server responded with a status of 500(System.ServiceModel.ServiceActivationException)

7/16 实习刚开始接触公司项目,创建WCF服务svc文件时出现

Failed to load resource: the server responded with a status of 500 (System.ServiceModel.ServiceActivationException)

约定“Service”中的操作“Opreation”为 WebGetAttribute/WebInvokeAttribute 指定了方法“*”,但方法允许的值只能是 GET 或 POST。“System.ServiceModel.Description.WebScriptEnablingBehavior”不支持其他值。

解决方法:

在web.config文件中<system.serviceModel>

===》<behaviors>

===》<endpointBehaviors>

下的 <enableWebScript />改成 <webHttp />即可

猜你喜欢

转载自blog.csdn.net/qq_35441385/article/details/81240046