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 />即可