Package com.google.code.magja.service

Examples of com.google.code.magja.service.ServiceException


    try {
      soapClient.call(ResourcePath.SalesOrderShipmentAddComment, params);
    } catch (AxisFault e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }
  }
View Full Code Here


    Integer id = null;
    try {
      id = Integer.parseInt((String) soapClient.call(ResourcePath.SalesOrderShipmentAddTrack, params));
    } catch (NumberFormatException e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    } catch (AxisFault e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

    if(id == null || id <= 0) throw new ServiceException("Error saving track");

    track.setId(id);
  }
View Full Code Here

    Map<String, Object> result = null;
    try {
      result = (Map<String, Object>) soapClient.call(ResourcePath.SalesOrderShipmentInfo, id);
    } catch (AxisFault e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

    return (result != null ? buildShipment(result) : null);
  }
View Full Code Here

    List<Map<String, Object>> results = null;
    try {
      results = (List<Map<String, Object>>) soapClient.call(ResourcePath.SalesOrderShipmentList, filter);
    } catch (AxisFault e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

    for (Map<String, Object> result : results)
      shipments.add(buildShipment(result));
View Full Code Here

    try {
      soapClient.call(ResourcePath.SalesOrderShipmentRemoveTrack, params);
    } catch (AxisFault e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

  }
View Full Code Here

    Integer id = null;
    try {
      id = Integer.parseInt((String) soapClient.call(ResourcePath.SalesOrderShipmentCreate, params));
    } catch (NumberFormatException e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    } catch (AxisFault e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

    if(id == null || id <= 0) throw new ServiceException("Error saving shipment");

    shipment.setId(id);
  }
View Full Code Here

    try {
      Map<String, String> carriers = (Map<String, String>) soapClient.call(ResourcePath.SalesOrderShipmentGetCarriers, orderId);
      return carriers;
    } catch (AxisFault e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

  }
View Full Code Here

  @Override
  public void assign(Product product, ProductLink link)
      throws ServiceException {

    if (!ProductServiceUtil.validateProduct(product))
      throw new ServiceException("the product id or sku must be setted.");
    if (!validadeProductLink(link))
      throw new ServiceException(
          "you must specify the products to be assigned.");

    try {
      soapClient.call(ResourcePath.ProductLinkAssign, buildLinkToPersist(
          product, link));
    } catch (AxisFault e) {
      if(debug) e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

  }
View Full Code Here

   */
  @Override
  public Set<ProductLink> list(Product product) throws ServiceException {

    if (!ProductServiceUtil.validateProduct(product))
      throw new ServiceException("you must specify a product");

    Set<ProductLink> links = new HashSet<ProductLink>();

    for (LinkType linkType : LinkType.values())
      links.addAll(list(linkType, product));
View Full Code Here

  @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;
View Full Code Here

TOP

Related Classes of com.google.code.magja.service.ServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.