Fork me on Github s

Posts Tagged web services

Connecting to Magento Web Services with Java

I was in the unenviable position of needing to connect to Magento, a PHP ecommerce platform, web services using Java.  It was kind of difficult to get the classes generated from the WSDL so I figured I would throw the results up on my github account for any other poor sap in a similar position.

First, pull down the project using git:

git clone git://github.com/webdevwilson/magento-java.git

and build it with maven:

mvn install

Here is a quick example of how to pull an order using the generated classes:

MagentoServiceLocator serviceLocator = new MagentoServiceLocator();
String url = "http://domain.com/index.php/api/v2_soap";
Mage_Api_Model_Server_V2_HandlerPortType port = serviceLocator.getMage_Api_Model_Server_V2_HandlerPort(url);
String sessionId = port.login("username", "key");
SalesOrderEntity salesOrder = port.salesOrderInfo(sessionId, orderId);

I also have some wrapper code in there that makes it a little easier to call the API.

Checkout the project at https://github.com/webdevwilson/magento-java

There is another option. it’s called Magja and it is located at google code.

Tags: , , , ,

No Comments

Simple VIN API for decoding Vehicle Identification Numbers

Ever see a nifty tool that solves a problem for a particular domain that you may never encounter but wish you had a reason to use it?

I did that recently with this VIN API by the people at the PullMonkey blog.  It will easily decode a VIN, returning the make, model, year, and other useful information about the vehicle.  It was developed for Mr Quotey, a new free online insurance service.

Check out the post if you would like to try it out, it even provides a simple example written in Ruby.

Tags:

6 Comments