views:

300

answers:

1

Web services -> core data -> controller -> view and then reverse...

Sound right?

Or is there a better way, one that avoids the complexity of SOAP? Additionally can core Data recognize XML coming from SOAP?

Thanks // :)

+2  A: 

There are several good REST libraries that work on the iPhone if you want to avoid SOAP.

HTTPRiot - http://labratrevenge.com/httpriot/

ASIHTTPRequest - http://allseeing-i.com/ASIHTTPRequest/

ObjectiveResource - http://iphoneonrails.com/

I've used the first and last and between those two, I really like HTTPRiot - really easy to use, doesn't get in your way and converts both XML and JSON responses into NSArrays and NSDictionaries.

Core Data doesn't have any relation to Web services natively but you can easily populate managed objects from the data you receive from one of the above libraries.

Hunter
Fantastic! Three questions:1.Would you recommend using Core Data over the NSArrays or NSDictionaries?2. Do those libraries support https? 3. Google App Engine (GAE) and REST... do you know if the libraries you mention work with GAE?Thanks // :)
Spanky
If you need to persist the data you download, you probably want to use Core Data. These libraries just provide an easier transport layer when using REST services. Once the data is downloaded to your app, you can choose what you want to do with.I know HTTPRiot supports https. I assume the others do too but I haven't tried it.Regarding GAE, if whatever you're using there exposes REST endpoints, you can use them as any other Web service.
Hunter
Thanks Hunter :)
Spanky
Of course - feel free to accept the answer if it is what you were looking for.
Hunter