Wednesday, April 11, 2012

WCF RIA Services with JSON endpoint

Today I had the task to add a JSON endpoint for a WCF RIA service for which there exists a Silverlight client.
I wanted to state some problems that I encountered such that maybe others can get it to work faster:

According to some howtos the URL is composed as follows:http://localhost:[port]/[Name of Silverlight Project]-Web-[Name of Webservice]/Json/[Method name]e.g.: http://localhost:2002/MySilverlightApp-Web-DataAccessService/Json/GetArticles

The above URL always returned 404 Not found

My next pitfall was that my service class file was not in the web project but in a subfolder ("Services") of it

To solve that I had to modify the URL as follows:http://localhost:[port]/[Name of Silverlight Project]-Web-[Folder name]-[Name of Webservice]/Json/[Method name]e.g.: http://localhost:2002/MySilverlightApp-Web-Services-DataAccessService/Json/GetArticles

2 comments:

his is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up the excellent work. Notary Service