I just started doing some reading (new to xcode/iphone development) into web services and most articles say that apple has really dropped the ball on this ... why is this :S?
It's because Apple doesn't provide any Web-Service API, it's agnostic on this point and you basically have to hardwire anything with URL Requests.
Fortunately, there are third-party libraries out there like ASIHTTPRequest and RESTKit that can make your life easier when coding an app that needs to talk to a Web Service.
Related
I need to write a fairly simple Delivery Tracking application. The device needs to know information about the 'matters' such as status (delivered/awaiting delivery), type (for delivery/for pickup), address, payment accepted etc.
The iPhone part of the app seems very simple but in terms of hosting some kind of web service is the part I am unsure about.
Does Apple have some kind of service or recommending way of handling this?
The web service would need to store all the information about the matters and receive updates from the device when matters are delivered and then there is a possibility that new matters could be sent out manually from the depot.
These are the parts I am unsure about - any ideas?
There is no Apple recommended way or service. For a similar system to the one you are proposing I have a Ruby On Rails (http://rubyonrails.org/) backend application with MySQL database hosted by a third party. It took me a couple of weeks starting from no knowledge of RoR to get the Rails App and database up and running. I recommend Appress's Beginning Rails 3 as a good book to start with. You can develop and run Ruby On Rails on MacOSX and easily port your app to a Linux server when it sufficiently developed.
There are other web-services frameworks such as PHP or ASP.NET which you could use so long as they return data in the form of JSON or XML.
The Ruby on Rails app can render JSON or XML when the iPhone app sends a request via NSURLRequest. I'm using Objective Resource (http://iphoneonrails.com/) which takes care of a lot of work connecting to RoR backend but you can use the many open source JSON frameworks such as TouchJSON (http://github.com/schwa/TouchJSON) or use NSXMLParser, an Apple Objective-C class, if your request returns in the form of XML.
I'm about to implement a web app with pastry kit but I'd like to have it fetching data from a backend hosted on the net.
This backend is reacheable via a Web service... IS there a method in PAstry kit allowing me to call directly a web service and parse response data to update my page ?
Are you aware that PasrtyKit is an Apple project that has not been made publicly available and seems to have only been used by Apple in one project and that all the information and code libraries available have been reversed engineered by people curious as to what is in the package and therefore might change or go away at any moment and has no Apple documentation or support?
Given that the short answer to you question is you will have to google for what is available and then hack it yourself.
You might also want to look at AdLib. It's like Pastry but drives the documentation for the iPad and it might be a bit more accessible as it was built later than Pastry Kit.
Also it is just a guess on my part but i suspect the data sources as they work in DashCode and are reasonably well documented should work in AdLib or PastryKit as Apple would have no reason to change the model.
I am looking to develop basic client server data application to add value to a website.
The website is .net based and opening an api such as asmx web service, json or xml would be simple.
Can anyone tell me what are the limitations - technically, what is possible with flash and also what Apple consider to be good practice.
Does anyone have any Actionscript code examples?
I don't think anything with Flash involved is considered "good practice" by Apple...
Kidding aside, I would go with JSON, it fits ActionScript well, since ActionScript is based on ECMAscript. That JSON has less overhead than XML can also be a good thing on a phone (less bandwidth).
Working with XML is easy in ActionScript since it has E4X, but if you should at a later stage switch to Objective-C/Cocoa, I believe JSON is betters suited than parsing XML.
What you should probably avoid is setting up a SOAP web service. In my experience, it may look as a tempting option on the .Net server side, but is cumbersome to work with on the client side, in scripting languages like ActionScript (and SOAP has a lot of overhead).
All this said with reservation for that I haven't done any development for the iPhone using Adobe's Flash CS5 packager for iPhone.
Firstly i'm not a programmer but I am managing to work my way through developing my own iphone app for my photography business. I store all of my photographs with a 3rd party who make their API available for public use. I want to implement this API into my app.
I've spoken with the 3rd party and they have written all of the code on a windows based system and although they say its not tied to a windows platform i'm struggling to see or recognise any Objective-C commands within the API and so don't know where to start. They've also told me that its a SOAP based web service.
I'm wondering if anyone can tell me if I should be using the NSURLConnection method? My main desire would be to generate a UITable view of the photo categories I hold with the 3rd party as is the case with their own iphone app, which i should probably say is for members only so wouldn't suit my needs here.
I would really appreciate some assistance with this as i'd hate to have to result to paying a developer to build the app after falling at the last hurdle.
Many thanks
Steve
At a very basic level, SOAP APIs are just a standard HTTP requests against specific webserver that return XML responses. That third party may have a Windows-specific client-side library to speed up the development for some clients, but since you are developing iPhone app, you can't use that library.
You have two options:
- use NSURLConnection and NSXMLParser and directly talk to their webservers and parse the response yourself;
- look for an iPhone SOAP library you can reuse. Since SOAP is an industry standard, there's nothing that prevents anyone from building iPhone-specific libraries. However, I personally am not aware of particular ones.
Hope that helps. It's not the best answer, but at least it might give you an idea what to look for around.
Update: Quick search for "iPhone SOAP library" revealed the wsdl2objc project, though that one is rather old (not updated since 2009). There are other alternatives, listed in the How to access SOAP services from iPhone SO question.
Apple also has a Web Services Core Framework, but there's not much documentation on using it with iPhone.
Look at a sample app code which has soap specific files here:
http://mtgr8-a3.svn.sourceforge.net/viewvc/mtgr8-a3/trunk/nvObjects/soap-specific/
In your posting you have mentioned that the 3rd party provided public APIs. If so, can you provide the wsdl? I can covert it to ObjC with SOAP support for you. I am not using wsdl2objC, but something lot better. If it is public API, you don't have to pay me.
What is a strong iPhone framework to start out developing with, besides the SDK from Apple? Are there any that exist to speed up development time?
The biggest framework of this kind is Three20. Facebook and many other companies use this. Three20 is geared towards apps that pull data from the web. It helps with common patterns like a photo viewer or table view backed by web data. Another neat feature is that it has stylesheets, similar in concept to CSS.
Having said all that, some people like it and some do not. There was a brief period where apps using it were rejected from the App Store. Overall, the project looks to have improved since then.
ASIHTTPRequest
Excerpt
It is suitable performing basic HTTP
requests and interacting with
REST-based services (GET / POST / PUT
/ DELETE). The included
ASIFormDataRequest subclass makes it
easy to submit POST data and files
using multipart/form-data.
Also,
skpsmtpmessage
Excerpt
This code implements a quick class for
sending one off messages via SMTP on
the iPhone
EDIT:
A quick google search gave me this link
There is Mono Touch which enables you to develop using C#.