Re: REST, SOAP, XML-RPC, ...?
Re: REST, SOAP, XML-RPC, ...?
- Subject: Re: REST, SOAP, XML-RPC, ...?
- From: Andreas Grosam <email@hidden>
- Date: Mon, 05 Nov 2012 13:14:51 +0100
On 05.11.2012, at 01:12, Todd Heberlein wrote:
> Is there currently a standard, Apple-recommended way of doing interoperable client-server architectures?
That's not something Apple should recommend. However, new Apple technologies use a RESTful web service with JSON (e.g. Passcode).
>
> I accidentally backed into a solution that is Apache, PHP, and libcurl, and I figured I should go with one of the many standards out there. REST is pretty close to what I am already doing, and looks nice, clean, and simple.
RESTful (or better RESTlike) with JSON as transport format is most appropriate for many web services, and there is great support for libraries on Mac OS X and also iOS.
>
> But are there some nice client-side APIs that Apple recommends I use that will make it easier to build Mac and iOS applications that use some particular web service protocol? And if so, are these some server-side APIs (???) that I can use on the web server side?
There are a lot of frameworks, and there are probably many opinions of what is the "best" one.
My personal preference is using Rails for the web service, especially for the test environment. A Rails app is just too easy to setup locally for testing purposes. Currently, while developing my own network library or any specific REST API on the client side, I setup a Rails server application and start it within Xcode using scripts, which also loads test fixtures into the database. So, for example when I modify or create a certain POST request utilizing NSURLConnection, I can test whether it actually works as expected with the web service API. curl and tcpdump are useful tools to dig deeper if something does not work as expected.
For implementing a REST API on the client side, I use my own frameworks (for a reason). But there are others: AFNetworking or RESTKit, or ActiveResource (on GitHub) which I discovered recently. It essentially implements the Rails concept "ActiveResource" and utilizes CoreData with an IncrementalStore mapping to the Web service.
IMHO, there is no "REST framework" at all, since REST requires you to apply certain constraints, which must by integrated into your specific API. That is, you may want or have to implement application specific code for that certain API anyway. This cannot be accomplished through a "REST framework" -- it shall be merely a HTTP or Network framework, exposing the appropriate classes and methods to implement a RESTful API.
For JSON, I use NSJSONSerialization - or if required I use my own implementation which has more features and is faster.
Regards
Andreas
>
> Thanks,
>
> Todd
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden