开发者

JSON endpoint with .NET RIA Domainservice

开发者 https://www.devze.com 2023-01-05 16:44 出处:网络
I have created a RIA-service and added a JSON endpoint following this tutorial开发者_StackOverflow社区: http://www.c-sharpcorner.com/UploadFile/pchandraker/1320/. When testing it in the browser, hitti

I have created a RIA-service and added a JSON endpoint following this tutorial开发者_StackOverflow社区: http://www.c-sharpcorner.com/UploadFile/pchandraker/1320/. When testing it in the browser, hitting

http://localhost:52878/Project-Web-DomainService.svc/json/GetProjects

returns nothing. When inspecting the request in Firebug, neither the response headers or body is set. Hitting an invalid url, such as http://localhost:52878/Project-Web-DomainService.svc/json/GetProjectsINVALID returns a 404, saying "Endpoint not found" as expected.

Do I need to add additional metadata or configuration settings to either DomainService.cs or Web.config to get the JSON output?


Decorate your GetProjects functions from DomainService with [QueryAttribute(HasSideEffects = true)] attribute.

Good luck.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号