DATE: Apr 23, 2015
AUTHOR: Rahul Lokhande
Now it is a strange thing, but things that are good to have and days that are good to spend are soon told about, and not much to listen to; while things that are uncomfortable, palpitating, and even gruesome, may make a good tale, and take a deal of telling anyway.
-J.R.R. Tolkien, from “The Hobbit, or,There and Back Again”
In our most recent post about OFBiz Connect, we shared details about the SOAP API Extensions we created to facilitate integration between OFBiz and Magento. But that was only one small chapter of the story. In today’s post, we share the story-behind-the-story about our quest to develop a successful solution.
Our first major challenge was to select the APIs that would be best suited for the integration. Magento offers three options to access its web services: a REST API, an XML-RPC API and a SOAP API.
Unfortunately the REST API, at the time of implementation, provided only a subset of the services required by our integration. Our initial tests with the XML-RPC API revealed some technical issues, for example we have been unable to call API methods passing multiple parameters from Java.
On the other hand, the SOAP API is comprehensive, is the default option in Magento and the SOAP API v2, available since Magento 1.3, has improved compatibility with Java and .NET clients. For these reasons we ended up using the SOAP API to access Magento’s web services.
This solution required APIs that could provide the functionalities, such as setting up store data, sales orders, product relationship management, category and product sync. However we discovered that the APIs couldn’t provide some key information we needed from the Magento Store (such as shipping details, inventory count, store configuration and catalogs). We solved this problem by creating custom API methods that have been published as a Magento Plugin (download plugin here).
We also needed to enable both systems to “talk to each other” and sync data between both platforms in a smooth way. The first step was to analyze the workflows and identify the events and synchronization actions that should be triggered by them. We wrote custom services to manage sync operations for the catalog, products and orders workflows. We used the OFBiz Job Manager for scheduling the ‘pull’ and ‘sync’ services, which means that the OFBiz system triggers requests to the Magento system to pull/extract the necessary information and to sync both the systems.
This was the most challenging part of our quest. Our goal was to create a responsive, easy-to-understand, rich user interface that could enable users to setup the integration in as few as fifteen minutes. We accomplished this by creating a UI with a UIF Bootstrap-based design capable of meeting industry standards.
We hope that sharing the details of our quest will empower others to succeed in their OFBiz development endeavors. For more information about how to leverage the power and flexibility of OFBiz to benefit your business, contact us today for a free consultation!