Archive for the ‘ecommerce’ Category

Magento api with Java Client — problem with XML-RPC interface

Thursday, March 26th, 2009

One of the features touted by Magento is the api exposed via both XML-RPC and SOAP. I quickly (and successfully) tested the SOAP interface using the amazingly complete (and free) soapUI. I wanted to use XML-RPC, and decided to build a test client in Java. While trying to build a client, using the apache ws-xmlrpc library, I ran into a roadblock. The initial login and some other calls would work just fine, but some calls such as product.info would always cause an exception, similar to:

Exception in thread "main" org.apache.xmlrpc.client.XmlRpcClientException:
Failed to parse servers response: Unknown type: nil

I posted on the magento forum to no success (except to find a few others with the same problem). So I was on my own..

After some research, I determined that the problem (IMHO) is that the Magento api is incorrectly using the nil type in responses. According to the XML-RPC spec, nil is an extended type, and can only be used with a namespace (e.g. ex:nil) — see the data types section on the apache site. But, luckily, the ws-xmlrpc library can be easily extended to provide a work around, and the following solution worked for me.

(more…)

Playing with Magento

Thursday, March 26th, 2009

One of my side interests is eCommerce, primarily for building stores, and even more so from the programming side… I’m not really sure why, but it is an area that has always intrigued me… And recently, lucky enough to have the chance to “play” with it while working on some side projects. We were looking at osCommerce for a while, but eventually decided to focus on Magento. Both freeware, php-based platforms, but in the end, Magento had fewer warts.