SOAP APIs R Klunky or How to waste bandwidth for no good reason

The fact that SOAP is still around is, to be honest, absolutely beyond my comprehension. No serious effort seems to have been put into something like JSONRPC. Still, when it comes to some API calls, SOAP is pretty darn good, but this here is one example of it being used as just a waste.

I recently setup a client, who has a Spree Commerce Ruby on Rails store, with the Ebay Trading API. Basically, he lists items on his store, sends them to ebay, and his store is notified when they have sold on ebay, and are thus removed from his store, or when they sell on his store, they are ended on ebay. Pretty standard setup, nothing special.

The app subscribes to ebay trading api platform notifications which are sent to the server in a SOAP format. The SOAP notification that an item has sold is 11kb. Yeah, I know what you are thinking, that’s small. No, it’s not. When you are talking millions of users, it’s not small, it’s huge. The information that I actually need from that is 1.1k.

To be quite honest, I need even less.

Apparently the client notifications api sends out notifications in as REST kind of way, i.e. as a url with key=>value pairs. Really, all I need is: EventName=TheEvent&ItemID=2312398081

That’s all I use.

I understand that other people might need more information, and may be handling all kinds of specific situations, but that’s part of the point. Different people need different info, so just dumping all available information is bad implementation.

There’s a better way, a simpler way, and one that is not difficult, or impossible to implement. Even for eBay.

Make it either SOAP or REST and chooseable, and allow people to define REST Template strings, like myurl.com?event=%{EventName}&id=%{ItemID}

This is kind of an Occam’s Razor solution.

About Jason

I am a 31 year old programmer living in the south of France. I currently work actively in the fields of Ruby/PHP/Javascript and server/website administration.
This entry was posted in PHP/MySQL, Ruby on Rails, Ruby on Rails, Tips and Tricks, Topics, Web Design and tagged , , , , . Bookmark the permalink.