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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章