You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to iphonesdkd...@googlegroups.com
Does anyone here have any experience or tips on how to read an ASMX .NET (C# or VB .NET) Web Service that outputs JSON format?
I have the Web Service grabbing from a MSSQL database and outputting JSON, but now I'm just trying to figure out how to get my iPhone app to read it. I've tried a couple of tutorials online and haven't had much luck.
It doesn't seem to be very common that people are accessing MSSQL databases remotely from their iPhone apps, does it?
Any help you can give would be much appreciated! Sample Code would be even better. Thanks in advance,
________________
Tim Taylor
lzbob
unread,
Oct 19, 2009, 12:34:40 PM10/19/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to iPhone SDK Development
Tim,
I got your question via Romke. I have been using ASP.NET MVC to send
JSON data to use in an iPhone app. I use ASP.NET MVC versus ASMX
because it can act as a RESTful with very little work. You an see a
live sample here.
This is done to specifically make the data available in a platform
neutral way. An Android, Palm Pre or Blackberry app could also access
this data with ease. A .NET app could as well.
The data controller shows exactly how to do it and you will be happy
with how little code is involved.
The objects that return by passing to the Json method (which
serializes the object to JSON) are specifically value objects which I
populate with the data model. In these data controller methods I am
converting XML to JSON in 3 cases while one is converting an iCalendar
object to a simpler value object for use on the View in the iPhone
app. Offloading all this heavy lifting to the server in C# has cut
down on the work in Objective-C and from what I am reading, working
with JSON is much more memory efficient than XML.
You can get a good example of loading this data from this project.
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to iPhone SDK Development
I would go with TouchJSON over JSON-Framework because there are some
bugs in the JSON-Framework somehow related to the 3.1.2 release for
Snow Leopard. A friend of mine was using it but it stopped working for
him after Snow Leopard. He moved to TouchJSON and it works just fine.
It is also easy to change your code over to TouchJSON.
One thing I also noticed about loading data into an NSDictionary is
that if you try to load a JSON array that it will fail because it has
to start with a key, which is not how an array works. So I wrap it
with addition bits, like...