Wednesday, June 10, 2015

An example of a WCF web service that returns JSON


Currently developing a project in javascript, and at some point or another that means getting recieving some data from the server. Doing this properly, and for cross platform support means writing a service that can push JSON data.

VisualStudio has a nice template setup for WCF and ASMX services, but they push XML by default.
Some modification is needed for JSON, and also some web.config changes should be made to allow for cross domain interaction.

A sample project is uploaded here (zipped):
https://drive.google.com/file/d/0B6AihF9gdNcnWHEzZkZtNWVpUXM/view?usp=sharing

No comments:

Post a Comment