views:

619

answers:

2

Hi, I'm learning how to consume web services for a student project using the iPhone.

The top answer from http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone suggested using http://code.google.com/p/wsdl2objc/ to consume services.

However, I've tried using http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl for the WSDL, but it crashes the application.

Any thoughts? I'm not sure if the problem is with the WSDL or with the application.

+2  A: 

My experience with wsdl2objc is that it is immature at best. Apple's solutions (WSMethodInvocation and its kin) are little better despite their age. I wish there were some easy answer for you, but when you get down with it, my experience is you have two options:

  • Hand write the SOAP calls. For simple services this is possible, and it is actually my preferred solution if I can get away with it.

  • Wrap gSOAP-generated code in ObjC++.

Your best option of course is to find a way to avoid SOAP and use a REST interface if you can possibly get one.

If you're experienced in SOAP, then you may want to help out the wsdl2objc framework. They have a laudable goal. I haven't tried out the 0.6 release they put out this week. Maybe it's much better now. If you're trying the 0.5 release, maybe try again.

I know you're a student, so your needs are different. As a professional, I avoid SOAP in Cocoa like the plague, and fall back to gSOAP when I can't avoid it. Luckily REST is becoming increasingly popular, so I usually can dodge the bullet one more time.

Rob Napier
+1  A: 

http://sudzc.com/

it will generate Obj c soap client. here u can get example and documentation of your webservice if u giving your wsdl url

Sijo