views:

218

answers:

1

My iPhone app communicates with a RESTful service that provides JSON output. I've been generating JSON using mainly PHP. If I use a .NET web service or WCF service, will there be any limitations or differences I should be aware of in regards to JSON as input/output for the service? I'm not sure what to expect from .NET in this regard.

+1  A: 

One thing I noticed: .NET emits DateTime objects as

 \/Date(xxxx)\/

where xxx is the number of seconds or whatever. I had to eval that on the JAvascript side to get it to become an actual date.

Cheeso
Thanks. Other than the date, you believe there probably isn't much to be concerned about?
JSON is just JSON, right? Have you ever written a WCF service? That's probably the biggest hurdle.
Cheeso
see this example for a good start on a basic WCF service that emits JSONhttp://stackoverflow.com/questions/2086666/wcf-how-do-i-return-clean-json/
Cheeso
Thanks. That's a very good resource. Do you know of any issues on the input side? Meaning, am I OK to send JSON to the WCF service without having to do anything special?
No special requirements on the input side. You can send complex objects to WCF, too. For some suggestions on that, see this answer: http://stackoverflow.com/questions/2062053/passing-complex-objects-into-a-wcf-rest-service/2062143#2062143
Cheeso