@Override
public Set<ProductLink> list(LinkType linktype, Product product)
throws ServiceException {
if (!ProductServiceUtil.validateProduct(product))
throw new ServiceException("you must specify a product");
if (linktype == null)
throw new ServiceException("you must specify a link type");
Set<ProductLink> links = new HashSet<ProductLink>();
List<Object> params = new LinkedList<Object>();
params.add(linktype.toString().toLowerCase());
params.add(product.getId() != null ? product.getId() : product.getSku());
List<Map<String, Object>> results = null;
try {
results = (List<Map<String, Object>>) soapClient.call(
ResourcePath.ProductLinkList, params);
} catch (AxisFault e) {
if(debug) e.printStackTrace();
throw new ServiceException(e.getMessage());
}
if (results == null)
return links;