简体   繁体   中英

iPhone app for a Java based website

I have a website which is developed using Java/Spring. We are about to develop an iphone application for the same. How do we make the phone communicate with the web application? 1) Use http get/post from objective c 2) Create web services for all the features provided (each user action) and then call those from objective c.

Any thoughts on the above or better ways to do this?

I would use some form of web service. It's the easiest way to ensure that any future applications can also speak to the server without rewriting things yet again. For example, what happens when you want to release a Windows Mobile app, or an Android app down the road? Plus, with modern tools and frameworks, it's pretty easy to write a web service, and easy to consume it on the client side. That makes more sense than overcomplicating things with something not quite as standard.

If you already have full support for http get/post you will be able to use that fairly easily on the iPhone. NSMutableHTTPURLRequest through NSURLConnection is how you do a post.

It also depends on the nature of the data your are sending and returning. If the posts or responses are complex data structures, then using web services will package those up nicely. If you already have xml or json, or are just passing around blocks of text, then web services is not needed.

http get/post is web service.

if by web service you meant these complicated ws-* crap, don't. especially on a phone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM