About the Author

author photo

Adam Trachtenberg is the Director of the LinkedIn Developer Network, where he oversees developer relations and marketing for the LinkedIn Platform. Before LinkedIn, Adam worked at eBay in platform product management and marketing. Even earlier, he co-founded Student.Com and TVGrid.com. Adam is the author of PHP Cookbook and Upgrading to PHP 5. He lives in San Francisco.

See All Posts by This Author

eBay SOAP using PHP 5 ext/soap and AJAX

I’ve been playing around with a nifty skunkworks project using our SOAP API, the ext/soap extension in PHP 5, and the fad du jour of AJAX.

Progress has been moving a long at a nice clip, as long as I can find time to work on it. One of my main goals is to more extensively test the compatibility between ext/soap and eBay’s SOAP interface. With the release of PHP 5.0.4, you can finally make SOAP API calls to our servers. I’d done enough to confirm this, but I’d done minimal testing to verify if this applies to all 100+ API calls. Now I’m trying to throw some real-world tests at the extension.

The bad news is that I’ve found a bug. The good news (for PHP) is that the bug is on eBay’s end. :)

The eBay SOAP API is almost 18 months old, but historically many of our developers have used our legacy XML API, which is based on a different codebase. That older codebase has extensive burn in and testing. The newer SOAP codebase is still well-tested (we have over 10 dedicated API QA engineers in addition to the many millions of API calls made by developers), but there are some dark little corners that are not as well-lit.

It turns out I stumbled down one early this morning involving our Motors site. Apparently, according to our SOAP API, the car I’m searching for has 154242 miles and, by an odd twist of fate, was also released in the year 154242. Heh.

We’re in the process of a giant migration, where all the legacy XML API developers move over to share the new SOAP API codebase. (You don’t need to move over to SOAP as part of this transition, but the data schema is changing to one that’s more well-thought out and coherant.) I suspect as we close in on the cutoff date of next June, we’ll run into a few more of these buglets. This is why we’re encouraging people to start porting sooner rather than later.

Unfortunately, when you expose so much data in so many different ways off of a dynamic database driven site, you’re never going to be able to find everything ahead of time. Fortunately, with more eyeballs, all bugs are shallow, and I know our API team will roll out the fixes in no time.

On the AJAX side, JavaScript is a surprisingly cool language. Its always gotten a bad rap, but I believe that’s more due to browser incompatibility issues than fundamental core design problems. For example, in this project I’m using a function closure within a function closure. How zany is that?

Much magic indeed.

Popularity: 3% [?]

There Are 3 Responses So Far. »

  1. Can you point me to some nice code samples for php, soap (just the built in php5 soap), accessing ebay webservices?

  2. I sure wish eBay would open up their web services w/o limitations, just like Amazon did. There are a ton of sites out there that would love to drive traffic to eBay but can’t/don’t want to/shouldn’t have to pay to drive one of eBay’s revenue channels. I’m not interested in uploading products or accessing account data, would just love to be able to pass a keyword through a URL and get a nice XML doc as a result that I can parse. Just a thought you might pass on. Maybe there’s already a way to do this and I’ve just missed it?

  3. Good news. We fixed this last month. You can now access our Web services through the Individual Tier for free.

    http://www.trachtenberg.com/blog/?p=85

    Also, we do have a simple REST interface for searching the product database. My co-worker Alan Lewis has a blog post on how to do this:

    http://alanlewis.typepad.com/weblog/2005/03/exploring_the_e.html

    Enjoy!

Post a Response