Playing with Amazon E-Commerce Service 4.0

I decided I'd tap into Amazon's newer version of their Web services for my forthcoming volleyball site. I noticed a lot of interesting things.

First off, their WSDL is hosed and has XML name duplication, which causes a Visual Studio referenced class to choke at runtime. XML is not my strong point, but I figured out the first part of their fix on my own. The second part is a mystery to me (though it works), because frankly I don't care to know the inner-workings of a generated proxy class. SOAP gives me a headache, and I just want it to work. I'm sure I'll catch flack for that when my book comes out.

Speaking of code samples, it's stunning to me that there are so few really good code samples on how to use the services with .NET. Maybe because I'm a .NET code monkey that's surprising, but for all of the .NET questions posted in their forum, you'd think they'd take a moment away from their Java samples to generate this stuff.

I more or less figured it out, and I cranked out searches, book details, and the really cool part, remote cart management, without a lot of serious issues. Everything follows the pattern: request item object -> request object -> action object -> response object from service call. Each item uses the previous as a property, with additional properties assigned along the way before finally calling the service. It's fairly logical once you've done it a few times, but there's a lot of redundancy too. For example, you would think that the logical place to pass in your associate ID and developer ID would be with the object that calls the service, but instead you pass it in with the action object. Perhaps it's more logical for people using raw XML or simple HTTP requests with query strings.

The only really annoying thing I've encountered is the condition of the HTML in some of the content. The reviews are hopelessly malformed, especially for older titles. The editorial descriptions are even worse. I found one with an unordered list where each item was not closed, and additionally had p tags (opening only) on each list item. What a mess.

That annoyance aside, they pretty much have everything open there for you, and the performance is pretty good. I'm seriously impressed at the amount of data available, even compared to v3. Neat stuff.

It would be ineresting to see what you get out of Salesforce.com's services. But I'm still bitter I didn't build something like that myself back in the day when we talked about it at my former job. Stupid executives. "No one will ever use that stuff online."

No Comments