*/
@Override
public void updateInventory(Product product) throws ServiceException {
if (product.getId() == null && product.getSku() == null)
throw new ServiceException(
"The product must have the id or the sku seted for update inventory");
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("qty", product.getQty());
if (product.getInStock() == null)
product.setInStock(product.getQty() > 0);
properties.put("is_in_stock", (product.getInStock() ? "1" : "0"));
List<Object> param = new LinkedList<Object>();
param.add((product.getId() != null ? product.getId() : product.getSku()));
param.add(properties);
try {
soapClient.call(ResourcePath.ProductStockUpdate, param);
} catch (AxisFault e) {
if (debug)
e.printStackTrace();
throw new ServiceException(e.getMessage());
}
}