Monday, June 2, 2008

Web Services Core

I've been doing a lot of work with Web Services Core lately. Although I honestly hate to criticize Apple, I must say they've really dropped the ball with their Web Services support. SOAP web services have moved forward quite a bit, but Web Services Core seems to be frozen at circa 2003 functionality, and WSMakeStubs is even worse.

The first, and more minor problem I've hit recently, is that WSMakeStubs doesn't provide an easy mechanism for supporting HTTP authentication. That's not too big of a deal since it can be worked around with a few tweaks to the generated code. Web Services Core does provide a way to support this, but it's not necessarily something that would be obvious to somebody new to the platform.

The show-stopper, however, for many web services is that there is absolutely no mechanism for specifying attributes for an XML attribute that's passed inside your SOAP envelope. So, if a web service requires some piece of information to be passed in using an attribute, you're pretty much screwed.

There is a way to make Web Services Core do this, but it's such a hack, that you'd probably be better off rolling your own client libraries. It involves writing your own serializer and overriding the XML serialization for the CFTypes you use. It's an ugly hack, difficult to implement and even harder to explain. It's not the type of code you want to maintain if you're likely to have much turnover in your development staff.

I opened a bug report with Apple, but I'm not overly optimistic that they'll fix this, to be honest. They don't seem overly concerned with SOAP web services at the moment. 

This could be a big deal if you're an iPhone developer, though. You see, Apple appears to be trying to position the iPhone into the enterprise by adding Exchange support, and a lot of new iPhone developers that I've met come from a background of working in Corporate IT shops. Many of the web services used inside the corporate enterprise are written using Microsoft tools that support (and even encourage) using attributes in the XML tags in SOAP methods. In fact,a prime example of this is the Exchange WSDL itself. It has required attributes in at least one tag on every single exposed method. This means you currently can't write a Cocoa client for even a single exposed method from the Exchange WSDL using WSMakeStubs or Webs Services Core. You can write one, of course, but it's going to be a lot of work.

I'm honestly concerned about the impression this is going to leave on people coming to the iPhone from .Net, which has very robust Web Services libraries. Many of the new Cocoa developers I've talked to lately have experience with .Net. Of course, the long-time Cocoa developers are trying to convince these newcomers how wonderful Cocoa is, but things like this kind of get in the way of proving that point. 




27 comments:

Luke said...

Same problem here, I can't figure it out. I hear Apple has an example of SOAP implementation on the way though.

UI Labs said...

Coming from Java to Cocoa, I am too disappointed with the WebService support in the language. WSMakeStubs in particular is just awful.

Jellodog said...

I have exactly the same problem - I've been using the Mac OS X / Cocoa platform for years, but my day job is coding .NET in the Enterprise. Our principle tool for platform interoperability is SOAP, and I am specifically interested in talking to our services from the iPhone.

Right now, this is looking like a deal-breaker. I really hope Apple have an ace up their sleeve concerning this, and that they reveal it soon... It's hard to understand when so many other aspects of Apple's platform really kicks ass.

John said...

Glad I found your post. Been thinking about building an iPhone app, and one of the things that interests me most is extending it for enterprise use.

Ahh well, just have to wait until they get their act together. I do find it hard to believe that they don't have better support for this. Its one of the easiest ways for people to build useful apps for the iPhone.

Joe said...

Plan on doing XML parsing yourself. Here's some reference links to other's who have done this quite effectively:

using libxml2 : http://inessential.com/?comments=1&postid=3489

using NSXMLDocument : http://weblog.bignerdranch.com/?p=48

Includes XML parsing code:
http://code.google.com/p/gdata-objectivec-client/

bpstylianos said...

hi all,

i'm a beginner so i need your leniency if i say something wrong.

I saw that there is a way to call a web service with AJAX(http://www.ibm.com/developerworks/webservices/library/ws-wsajax/), additionally
i saw that you can call javascript from objective C. So my question is if you can develop a web server client using Ajax from objective C.

thanks

Scott said...

Same problem here, looking for an iphone soap client to access a soap service. Coming from a bit of PHP background it's surprising there isn't one yet. Something like the PHP soap client would really add a lot.

petertparker said...

Hi Nice Blog Welcome to prodigyapex's web development services services.Our missionis to deliver high quality web design and development at reasonable prices. Explore our site and compare our prices - we're confident we an provide a web presence solution for you.wide variety of solutions based on your needs. To begin, we provide detailed proposals for your project. We are able to work small projects on an hourly basis or develop package deals for the more involved projects. We also provide turn-key solutions for your web presence needs.

webmaster said...

While venturing into the world of online business, it is indeed primarily important for you to get hold of efficient ecommerce solutions that are likely to pay dividends for you and if you have not discovered a top-notch ecommerce solution providing company till now, you are suggested to come in touch with http://www.infyecommercesolution.com instantly. Your search ends right here with Infinity and with the cheap and effective ecommerce packages provided by the company, you would surely scale the heights of online business in no time.

Mike said...

Hi, I've been tasked with estimating an enterprise iPhone app that would rely heavily on consuming web services. I've been googling nearly a full day and this is one of the best posts I've found. Unfortunately, I still can't find a client library, only random people's code snippets. Has anyone heard anything about if and when apple or somebody will release this?

Rutger said...

I am also looking into this since i have a customer who wants me to port an WM6 application to iPhone OS. Web-services play a crucial role in this. So i was wondering if there is any news on this for example in the new 3.0 SDK?

seo.media said...

Won't you wonder if somebody says he doesn't know what is a software company ? Am sure you will fall off from your chair. But believe me it is true. There still are people in third world countries who don’t know anything about software development, web application development or internet. So those who are not really aware about these buzzing things, try to find out what is a tech-world of Internet.

achyut said...

Its highly informative. I would be visiting your blog hereafter regularly to gather valuable information.

Freelance Web Design Portfolio India

chang said...

wow! thanks for another great blog post!
Customized application development

kristinawils said...

Great post and very well written, that will really help you to learn Web Design, web development and SEO Strategies to help businesses web design company . You can find out many useful information about web design, seo and his work by visiting his blog and I Just wanna say thanks you for the information you have shared. Web Design Company India

Ryan said...

Really an informative Blog. Thanks fro sharing. I know about a web designing experts. Actually I was very impressed with the professionalism and quick response time of Vane Technologies and hired their full time designing services. Its interesting that they not only offer a customized optimization plan but also provide a superb discount on their designs.

Web Development Company said...

Even i am also facing the same problem. iPhone development is main role in web services. Thanks for sharing nice information. Awesome post.

e-Definer Technology - Web Design Company said...
This comment has been removed by the author.
Web Developers Chennai said...

We are one of the Leading Web Design Company in chennai,our services are web design,web hosting,email marketing,seo chennai etc.your blogger looking so good ..please add my details to your blogger,it is very use ful for us thanks...

leather-product said...

Recover your lost digital images, audio, video and data files with Media RECOVER software. Photo recovery

recordingstudiosoftware said...

"Although I honestly hate to criticize Apple"

Why, anybody can make a mistake and anybody can be wrong.

Silvio said...

Thank you for the info. It sounds pretty user friendly. I guess I’ll pick one up for fun. thank u

SEO Company Chennai

suchi said...

I think that this is really a good way to show that the website still exists, as this would help to show the presence of the business.

Houston movers

h4ns said...

What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.

Arsenal vs Huddersfield Town live streaming
Arsenal vs Huddersfield Town live streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Notts County vs Manchester City Live Streaming
Notts County vs Manchester City Live Streaming
Bologna vs AS Roma Live Streaming
Bologna vs AS Roma Live Streaming
Juventus vs Udinese Live Streaming
Juventus vs Udinese Live Streaming
Napoli vs Sampdoria Live Streaming
Napoli vs Sampdoria Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
AS Monaco vs Marseille Live Streaming
AS Monaco vs Marseille Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Technology News | News Today | Live Streaming TV Channels

Sonia said...

Hi. Greetings. This post is really good and blog is really interesting. It gives good details.

Website Development Company

Arpit said...

To have better idea about the same just click on the link given hereby at Web Development Services

sashastri said...

just linked this article on my facebook account. it’s a very interesting article for all.
Web Design Services Chennai