Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Programming Software IT Technology

REST vs. SOAP In Amazon Web Services 29

tadghin writes "I was recently talking with Jeff Barr, creator of syndic8 and now Amazon's chief web services evangelist. He let drop an interesting tidbit. Amazon has both SOAP and REST interfaces to their web services, and 85% of their usage is of the REST interface." Read on for some more thoughts and information on REST and Web services, including information about a free Web services seminar on April 22nd.
" Despite all of the corporate hype over the SOAP stack, this is pretty compelling evidence that developers like the simpler REST approach. (I'm sure there are applications where SOAP is better, but I've always liked technologies that have low barriers to entry and grassroots adoption, and simple XML over HTTP approach seems to have that winning combination.)

Amazon's web services have attracted a thriving community, people are making real money building alternate interfaces to Amazon and collecting Associates commissions on the resulting sales, and there are even tool developers who have come up with the creative business model of agreeing with their users to have some percentage of the transactions use the tool developer's Associates id rather than the site owner's. Cool.

Amazon is holding a free all day web services workshop on April 22 at the O'Reilly Emerging Technologies Conference. The event is open to people not registered at the conference (though space is limited to 50 people).

P.S. Slashdot really ought to have web services as a topic area! Despite being over-hyped, this is a really important area, and there's a lot cooking. Amazon's web services"

This discussion has been archived. No new comments can be posted.

REST vs. SOAP In Amazon Web Services

Comments Filter:
  • REST or SOAP: yes (Score:4, Insightful)

    by jnana ( 519059 ) on Thursday April 03, 2003 @04:33PM (#5655318) Journal
    Just how do you submit a complex transactional XML document using REST? Parsing a URL query string with 200 name-value pairs, then assembling that back into the XML document that the recipient expects does not seem like a good solution. Surely, submitting a SOAP document that wraps the XML document is better in this case.

    It is understandable that Amazon sees most people using REST. They're mostly hobbyists and amateur programmers, and REST is easier and sufficient for the very simple things that you can do via the Amazon web services api, but if one were trying to submit more information -- say a long purchase order -- the limitations of REST would be more apparent. The RPC style of SOAP is often better with REST, but for the document-exchange style, REST is inadequate.

    • Re:REST or SOAP: yes (Score:3, Interesting)

      by pmz ( 462998 )
      They're mostly hobbyists and amateur programmers, and REST is easier and sufficient for the very simple things that you can do via the Amazon web services api, but if one were trying to submit more information -- say a long purchase order -- the limitations of REST would be more apparent.

      I would bet there are significant numbers of professionals using REST, too. It has a pretty high usefulness threshold, because a lot of tasks don't require the complex hierarchical datasets allowed by XML.

      I've personall
    • This webservice is not complicated enough for SOAP to be worth while.

      Parsing a URL query string with 200 name-value pairs, then assembling that back into the XML document that the recipient expects does not seem like a good solution.

      That does not describe Amazon's interface. There are a handful of parameters at most.

      SOAP is not the best solution for all problems like this. In the Amazon case, REST may be better in some (many?) cases.

      -Pete
    • REST is not mutually exclusive from PUTing or POSTing a complex XML document when necessary. SOAP, however, does make simple GET operations stupidly overcomplex and hard to cache.
    • Re:REST or SOAP: yes (Score:3, Informative)

      by smallpaul ( 65919 )
      You don't undestand what REST is. There is nothing about REST that disallows the posting of an XML document. The question is how you use URLs and HTTP verbs, not what syntax you use. You say that "surely submitting a SOAP document that wraps an XML document is..." There is no question that XML is the right choice in some cases. That's why REST and XML are so often used together. But if you're going to claim that there is some benefit in "wrapping" the XML in SOAP, you'll have to back it up. In my experienc
    • Re:REST or SOAP: yes (Score:3, Informative)

      by Kopretinka ( 97408 )

      Just how do you submit a complex transactional XML document using REST? Parsing a URL query string with 200 name-value pairs, then assembling that back into the XML document that the recipient expects does not seem like a good solution.

      The above shows just how little jnana understands REST. Note that SOAP over HTTP uses POST and does not do any URL encoding of the requests. Just why can't a simple HTTP application do the same?

      HTTP GET is to be used for retrieval only, and all URL encoding that may hap

      • Oh yes, I forgot to mention that SOAP currently uses HTTP as the underlying transport protocol. By using POST only, it limits the usefulness of those resources to the rest of the HTTP World Wide Web.

        That's why SOAP 1.2 tries to allow the use of other HTTP methods where appropriate, so that ideally services using SOAP 1.2 over HTTP will be fully-fledged HTTP resources and will fit into the Web world.

    • Re:REST or SOAP: yes (Score:3, Informative)

      by j7953 ( 457666 )

      Just how do you submit a complex transactional XML document using REST?

      You can use HTTP POST with REST, so you simply POST the XML document to the appropriate URL (probably an URL that identifies some sort of handler).

      Surely, submitting a SOAP document that wraps the XML document is better in this case.

      But why do you want to wrap it?

      The thing that is "wrong" about SOAP is that everything is wrapped into a POST request, even if you aren't posting anything but simply requesting some information.

      For

      • erhemm...

        I think you will find that SOAP is transport agnostic - ie you could use it over SMTP in an email message.

        HTTP post is only one of the methods of delivering a SOAP envelope.
  • Amazon patents the use of REST and SOAP...

  • From the FAQ [amazon.com]:

    Why does Amazon Web Services use both SOAP and XML over HTTP?

    We wanted to provide a platform that would both address the different needs of different people and provide an opportunity to further the debate between two popular Web services standards. Some developers like working with pure XML; others prefer SOAP. We didn't want to force people to use a protocol they weren't comfortable using.

  • by darkpurpleblob ( 180550 ) on Thursday April 03, 2003 @05:13PM (#5655691)
    Tim O'Reilly played a integral part in getting the Amazon Web Services off the ground:

    Jeff was intrigued, and told me a day or two later that he'd discovered that his skunkworks team already had a web services API in the works. But he says that without my presentation he "might have done something stupid like shutting the project down.

    Read about the rest in Tim's weblog post [oreillynet.com].

  • I developed www.bitworm.com (Computer Books) [bitworm.com] using the XML over http service. I have never used SOAP, and have never seen a reason to. With their server side XSL translations, I retieve custom responses designed to conserve bandwidth/response when combined with my caching backend. I don't think I can do that with SOAP.

    SOAP is just too much work in the Amazon case with little ROI. XML is just as simple when used with JDom, or another simple parser.

    (Smart) people will use the right tool for the job. In
  • by Kagato ( 116051 ) on Thursday April 03, 2003 @05:39PM (#5655893)
    Having worked with Amazon for one of Amazons largest online stores I can say SOAP is very much here to stay. Although many may use RIST, the big online partners use SOAP. Or rather Amazons implimentation of SOAP. With does some funky stuff with MIME attachments.

    Still, once you get it worked out the process is actually pretty smooth. All my complaints are about how they use their data, not how it's transported.
  • by Anonymous Coward
    Over the weekend, I rewrote parts of my site that use Amazon data to use SOAP, with the help of nuSoap for php. It's much cleaner code now, and it just seems to work better. I originally went with REST because it's what they first offered, and I was just too lazy to update the code until now.
  • by cpeterso ( 19082 ) on Thursday April 03, 2003 @06:05PM (#5656129) Homepage

    A quiet alternative is MIME-RPC [mime-rpc.com].

    MIME-RPC is a protocol for applications written in different languages and on different platforms to communicate with each other using a public standards:
    • It works with the millions of already deployed web apps and web browsers (without plugins)
    • It handles all Internet data including Unicode, JPEG, XML, etc.
    • It works over both HTTP and SMTP (web and email)
    • It protects application programmers from wire level concerns.
    • It provides complete interlanguage object serialization (cyclic refs.) as well as interlanguage messaging
    • It supports two way communication over client/server connections
    • It is easy to implement.
    • It doesn't require an extra XML parser when your application doesn't need one.
    • Its specification is short and unambiguous.
    • It leverages existing transport layer features like encryption, proxying, asynchrony, streaming/chunking, etc.

    Notes on SOAP vs MIME-RPC:
    • SOAP does not interoperate with existing browser based apps. MIME-RPC does.
    • SOAP does not do generic object serialization
    • SOAP forces the programmer to think about type coercion because it hides foreign data as base64encoded rather than labeling it with a useful type.
    • SOAP does not handle delivery of XML or other types well. MIME-RPC does.
    • The SOAP with attachments spec basically says to use MIME. If you are doing that, you might as well use MIME for everything (and therefore MIME-RPC).
    • The SOAP with attachments spec is ambiguous about the type of attached objects. Should the type be interpreted according to its mime content-type or according to some XML schema? MIME-RPC provides an unambiguous interpretation.
    • SOAP constrains method and variable names to be consistent with XML tag names. Many languages (e.g. SQL) allow method and parameter names that are not permitted in XML tags.
    • MIME-RPC is much easier to implement correctly than SOAP
    • MIME-RPC has less processing overhead than SOAP.

  • The question is, does Amazon's REST take into account the Evil Bit? Remember, if you're evil we need to wash your mouth out with SOAP!
  • Geeks prefer to rest than to use soap.
  • Use some helper code (Score:4, Informative)

    by bill_mcgonigle ( 4333 ) on Thursday April 03, 2003 @08:16PM (#5657145) Homepage Journal
    I have a system that uses XML/RPC but it could have just as easily been SOAP or REST and it wouldn't make a difference. I have a data structure in Java that gets put through some helper classes, then on the server side, I have a response that feeds into a module, and I get out a data structure. So, I never actually see any XML/RPC, but I still have the advantages of the interoperability of the standard. Moral: if you're doing much with any of these protocols your code could use some more abstraction.
    • This is so true. Your client code should look something like:

      Client client = new XMLRPCClient("host", "userid", "passwd");
      client.doStuff();

      Abstract all the underlying protocol stuff behind that Client interface and your code will be much easier to read and understand...

      Tom

What is research but a blind date with knowledge? -- Will Harvey

Working...