Zend Framework XML-RPC? - zend-framework

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

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.

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

Which technique should I use to consume a .NET Web Service from the 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.

SOAP, REST or just XML for Objective-C/iPhone vs. server solution

We are going to set up a solution where the iPhone is requesting data from the server. We have the option to decide what kind of solution to put in place and we are not sure about which way to go.
Regarding SOAP I think I have the answer, there are no really stable solution for doing this (I know there are solutions, but I want something stable).
How about REST?
Or is it better to just create our own XML? It's not going to be so complicated reguest/respons-flow.
Thanks in advance!
I've created an open source application for iPhone OS 3.0 that shows how to use REST & SOAP services in iPhone application, using XML (using 8 different iPhone libraries), SOAP, JSON (using SBJSON and TouchJSON), YAML, Protocol Buffers (Google serialization format) and even CSV from a PHP sample app (included in the project).
http://github.com/akosma/iPhoneWebServicesClient
The project is modular enough to support many other formats and libraries in the future.
The following presentation in SlideShare shows my findings in terms of performance, ease of implementation and payload characteristics:
http://www.slideshare.net/akosma/web-services-3439269
Basically I've found, in my tests, that Binary Plists + REST + JSON and XML + the TBXML library are the "best" options (meaning: ease of implementation + speed of deserialization + lowest payload size).
In the Github project there's a "results" folder, with an Excel sheet summarizing the findings (and with all the raw data, too). You can launch the tests yourself, too, in 3G or wifi, and then have the results mailed to yourself for comparison and study.
Hope it helps!
REST is the way to go. There are SOAP solutions, but given that all people end up doing with SOAP can be done with RESTful services anyway, there's simply no need for the overhead (SOAP calls wrap XML for data inside of an XML envelope which must also be parsed).
The thing that makes REST as an approach great is that it makes full use of the HTTP protocol, not just for fetching data but also posting (creating) or deleting things too. HTTP has standard messages defined for problems with all those things, and a decent authentication model to boot.
Since REST is just HTTP calls, you can choose what method of data transfer best meets your needs. You could send/receive XML if you like, though JSON is easier to parse and is smaller to send. Plists are another popular format since you can send richer datatypes across and it's slightly more structured than JSON, although from the server side you generally have to find libraries to create it.
Many people use JSON but beware that it's very finicky about parsing - mess up a character at the start of a line, or accidentally get strings in there without escaping "'" characters and there can be issues.
XML Property-lists (plist) are also a common way to serialize data in Cocoa. It is also trivial to generate from other languages and some good libraries exist out there.
You are not saying how complex your data structures are and if you actually need state handling.
If you want to keep your network traffic to a minimum, while still keeping some of the structured features of XML, you might have a look at JSON. It is a very light weight data encapsulation framework.
There are some implementations available for iPhone, for instance TouchJSON
Claus
I would go with simple HTTP. NSURLConnection in the Cocoa libraries make this pretty simple. Google Toolbox for Mac also has several classes to help parsing URL-encoded data.
I think it's obvious that REST is the new king of servers communication, you should definitely use REST, the questions should be what REST methodology you should use and what coding language, in my post I present few very simple implementations for REST servers in C#, PHP, Java and node.js.

iPhone application talking to a web service, the basics

We have an iPhone application created by an external consultancy that we're planning to add card payment facilities to in a subsequent release.
We plan to host a service ourselves in order to process the payment stuff, with SSL encryption. We have in-house expertese for all of this apart from the (contracted out) iPhone bit.
Are there any specific gotchas that we should be aware of that concern designing web services for iPhones?
We'll be writing the web service in C# 3.5.
JSON data format is better to be converted into NSArray or NSDictionary objects. It's easier and faster to be parsed.
So, specifically for the iPhone, it's a lot better to consume JSON data. Unless if there's some technical complexity that JSON is unable to handle.
Check YAJL:
http://github.com/lloyd/yajl
There are Objective-C wrapper/implementations by gabriel in github and by MGTwitterEngine.
TouchJSON is another code that's simpler than yajl. You can convert JSON string into NSDictionary or NSArray object in 2 lines of code. But, it maybe slower.
I'm not sure there are really any special considerations. The iPhone should be able to communicate with most types of webservice.
I worked on an iPhone app that communicated to a RESTful webservice written in Java.
I imagine it's pretty straightforward across the board - there are plenty of libraries for parsing/generating XML or JSON formatted messages, the iPhone can handle HTTP authentication, HTTPS, caching, etc.
It's just down to your iPhone developer to get it right :)
For SOAP based web services I strongly suggest that you try gSOAP. This library does not support Objective-C, however it supports C and C++ and is certainly the most complete open source project to access SOAP based web service; it also outperforms all of the other libraries.
For Objective-C you may want to try wsdl2objc, but I am not sure if it provides support for SSL/TLS (gSOAP does).
Finally, REST based web services are easily handled using ASIHTTPRequest.