WCF Configuration Hell?

前端 未结 7 795
迷失自我
迷失自我 2021-02-08 01:20

I hate WCF setup with endpoints, behaviors etc. I believe all these things should be performed automatically. All I want to do is to return JSON result from my WCF service. Here

7条回答
  •  佛祖请我去吃肉
    2021-02-08 01:33

    You are using the WebInvokeAttribute which tells WCF by default to accept POST as the verb. Since you are trying to access it via a GET action, it is being ignored.

    Use WebGetAttribute instead.

    Per MSDN:

    If you want a service operation to respond to GET, use the WebGetAttribute instead.

提交回复
热议问题