Which technique should I use to consume a .NET Web Service from the iPhone? - iphone

The description page for my .NET web Service includes 4 different protocols to use to consume it.
SOAP 1.1
SOAP 1.2
HTTP GET
HTTP POST
In my work-in-progress iPhone application I have used both SOAP 1.1 and HTTP GET to access the XML data and am then parsing to get the information I want.
I'm now refactoring the application and am creating a Data Library class that will use code-reuse to make my current data operations easier to maintain.
SOAP 1.1 seems straight forward enough, if a little unwieldy, are there any benefits for me to use SOAP 1.2 on the iPhone. I'm presuming the differences will have little consequence when all I'm doing is basic XML parsing for strings.
Also HTTP Get seems the easiest of the lot! A simple dataWithContentsOfURL appears sufficient to get what I need, I don't even need to do a post.
Are there any idiosyncrasies on the iPhone that make any of these techniques better than others?
I'm going to research a REST services now. I think I understand the concept of stateless but not sure how it applies to the 4 options above.
Thanks in advance!

dataWithContentsOfURL
Has always worked for me with no problems.

Related

How to consume ASPX webservices in iOS?

Could anybody clarify the process of consuming aspx webservices in iOS? I have already tried JSON framework but now, need to create an app that consumes .net webservices in XML format. I need both to post some data to, and get data from the server. I already read about existing XML parsers for iOS that I found (here)
The question is do I need to do additional setup, like wrapping my query strings in SOAP or smth, in order to communicate with webserver? Would it be sufficient to use only one of mentioned libraries in the link or do I need additional stuff?
UPDATE: I found one tutorial on web (here) that demonstrates how to consume web services using Json-framework. Also, I found another one that demonstrates it using NSXMLParser (here). I'm not not very familiar with WSDL and SOAP, so any detailed explanation on how to implement would be desirable :). In both of these examples you just have to construct a request string in xml format and execute it, and that's it. Both examples actually bypasses the heavyness of SOAP and WSDL, so I was wondering do I have to know and do more that just construct a request string, execute it and get response?
While wsdl2objc is out there (as noted by #Girish Kolari), the truth is that there's no easy answer. I've never successfully gotten wsdl2objc working well for something that I couldn't have done more easily by hand. You will need to learn SOAP and WSDL. That's just a fact of life if you can't get access to a REST interface. In my experience, your best bet for simple SOAP access is to do it by hand, and your best bet for somewhat complicated SOAP access is gSOAP. Your best bet for very complicated access is to redesign something so it's not so complicated, ideally in REST. SOAP is a giant pain that some languages (C#) shield you from. ObjC does not shield you from it, so it continues to be a giant pain.
Yes, SOAP leaves a bad taste in my mouth.

How to start use webservice

i want to read and write data to a website (server on web) and don't have any information about webservices and other things that related to it
Does anybody have any idea about how to start it (mean offer complete books,papers,tutorials,websites,… or what should i learn at first mean is it necessary to learn xml,soap,... and other things)
Thank you
I've used Google App Engine with great success. You would format your data to output as JSON and use an iPhone library to read it. I've used this one (though Touch JSON seems to be more popular).
Read about REST, ROA and AtomPub. Thats got me started. I'm about to implement some webservices in WCF (WCF now acts like a RESTFul webservice, but you can also use plain old SOAP). Before I got to WCF, I experimented with RoR. RoR uses REST "out-of-the-box".

Zend Framework XML-RPC?

I would like to build an XML over HTTP provisioning interface using Zend Framework. Should Zend_XmlRpc_Server be used for this purpose? If so, can you recommend any guides on using it? (Specifically the part retrieving incoming XML and parsing it.)
What kind of service is it? - will you send binary data or rather short texts? Will all clients be in PHP mostly or you are foreseeing a wide range of clients?
Usually if you're doing a web-based small service, REST will do the trick, it's easy to develop and consume, even by plain JS frontends, such as jQuery.
If it's something more complex, you can't go wrong with SOAP, though it's a bit complex in developing. Make sure you arm yourself with SoapUI
XmlRPC has some limitations, especially sending binary data. There's some thorough comparison to have a look at this blog

iPhone dealing with xml vs soap vs JSON vs RESTful

I do not have much experience coding systems dealing with web-services. Please help me in solving following confusion.
One of my clients want me to build an iPhone App that had native UI controls but deals extensively with Web Services. Right from authenticating the user into a network to loading a list of users or anything related in the app will need to talk to a web service.
They have web services deployed on .NET on the server side and already have required data in SOAP web service. By doing some basic research on the web it seems that dealing with SOAP from an iPhone app could be messy and affect performance.
The client is ready to make the data available in from of JSON or plain XML data. I am not sure which one would be a better option? The data could range from few tens to few hundreds of rows only.
Can someone please point me how can I do a comparative study in short period of time (3-4 days) even if it takes for me to learn about the SOAP, XML, JSON and REST web services. Is this even possible or should I just go with some expert advice? - Waiting for expert advice :)
Thanks
XML and JSON are data interchange formats. JSON is generally considered easier to work with, although a good library should make both palatable.
REST is an architectural style; it is the architectural style that HTTP is designed to support.
SOAP is a protocol for implementing web services, and it does not follow the REST architectural style; it's more of an Remote Procedure Call style.
I dislike SOAP because it forces you to rely on tools to manage many of its facets. If your tools happen to work differently than the tools used by the other end, then it becomes extremely painful.
I recommend reading RESTful Web Services for a general overview of REST, and why it's "better" than SOAP.
I don't have any good resources for SOAP, or anything iPhone specific.
RESTFul webservices can return responses in XML or in JSon, the option of using such service is better than soap for iphone because of the overhead involved with soap as you mentioned. Basically when u get responses in xml or json its just some text that you need to parse. I would recommend going with Json as there are json parser libraries for iphone out there already and its very simple to use...Here is a tutorial for using the json parser and parsing your responses, Json tutorial...hope it helps

iPhone WSDL service using HTTP POST and GET Bindings

I have a WSDL service that is working fine with .NET using HTTP POST Bindings, rather than using SOAP. The HTTP Post request returns the raw XML for the objects etc. removing all the overhead of SOAP.
I would like to use this within the iPhone. I have located the tool at wsdl2objc tool (http://code.google.com/p/wsdl2objc/) however it seems to only generate SOAP bindings which I don't use because I don't need the overhead.
What would be the best option for using WSDL HTTP POST Bindings within the iPhone OS? It would be great if the wsdl2objc tool also supported the HTTP POST bindings however I don't see that happening soon. I would rather have this code automatically generated for when the service changes etc.
Any ideas would be greatly appreciated.
It seems that there are very few code generators around for this kind of thing. For now I lumped with wsdl2objc but shrunk the size of the data being returned from the web service in a bid to make the XML smaller and more manageable. On a slower cellular connection that the iPhone sometimes has (2G etc.) I noticed slight improvement, but nothing worth an awards evening.