Package com.google.code.magja.service

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


                ResourcePath.CustomerCreate, customer
                    .serializeToApi()));
        customer.setId(id);
      } catch (NumberFormatException e) {
        if(debug) e.printStackTrace();
        throw new ServiceException(e.getMessage());
      } catch (AxisFault e) {
        if(debug) e.printStackTrace();
        throw new ServiceException(e.getMessage());
      }
    } else {
      try {
        Boolean success = (Boolean) soapClient.call(
            ResourcePath.CustomerUpdate, customer.serializeToApi());
        if (!success)
          throw new ServiceException("Error updating Customer");
      } catch (AxisFault e) {
        if(debug) e.printStackTrace();
        throw new ServiceException(e.getMessage());
      }
    }
  }
View Full Code Here


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

    if (list == null)
      return groups;
View Full Code Here

        setList = (List<Map<String, Object>>) soapClient.call(
            ResourcePath.ProductAttributeSetList, "");
      } catch (AxisFault e) {
        if (debug)
          e.printStackTrace();
        throw new ServiceException(e.getMessage());
      }

      if (setList != null) {
        for (Map<String, Object> set : setList) {
          if (set.get("set_id").equals(set_id.toString())) {
View Full Code Here

      }

    } catch (AxisFault e) {
      if (debug)
        e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }
    if (!success)
      throw new ServiceException("Not success deleting product.");

  }
View Full Code Here

      productList = (List<Map<String, Object>>) soapClient.call(
          ResourcePath.ProductList, "");
    } catch (AxisFault e) {
      if (debug)
        e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

    if (productList == null)
      return products;
View Full Code Here

      mpp = (Map<String, Object>) soapClient.call(
          ResourcePath.ProductInfo, sku);
    } catch (AxisFault e) {
      if (debug)
        e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

    if (mpp == null)
      return null;
    else
View Full Code Here

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

    if (mpp == null)
      return null;
    else
View Full Code Here

                .listByProduct(product)) {
              productMediaRemoteService.delete(media);
            }
          }
        } else {
          throw new ServiceException("Error updating Product");
        }

      } catch (NumberFormatException e) {
        if (debug)
          e.printStackTrace();
        throw new ServiceException(e.getMessage());
      } catch (AxisFault e) {
        if (debug)
          e.printStackTrace();
        throw new ServiceException(e.getMessage());
      }
    } else {
      // means its a new product

      // if is a configurable product, call the proper handle
      if (product.getType().equals(ProductTypeEnum.CONFIGURABLE.getProductType()))
        handleConfigurableForNewProducts(product);

      try {

        List<Object> newProduct = (LinkedList<Object>) product
            .serializeToApi();

        id = Integer.parseInt((String) soapClient.call(
            ResourcePath.ProductCreate, newProduct));
        if (id > 0)
          product.setId(id);
        else
          throw new ServiceException("Error inserting new Product");

      } catch (NumberFormatException e) {
        if (debug)
          e.printStackTrace();
        throw new ServiceException(e.getMessage());
      } catch (AxisFault e) {
        if (debug)
          e.printStackTrace();
        throw new ServiceException(e.getMessage());
      }
    }

    // inventory
    if (product.getQty() != null)
View Full Code Here

      productTypes = (List<Map<String, Object>>) soapClient.call(
          ResourcePath.ProductTypeList, "");
    } catch (AxisFault e) {
      if (debug)
        e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

    if (productTypes == null)
      return resultList;
View Full Code Here

      resultList = (List<Map<String, Object>>) soapClient.call(
          ResourcePath.ProductStockList, param);
    } catch (AxisFault e) {
      if (debug)
        e.printStackTrace();
      throw new ServiceException(e.getMessage());
    }

    for (Map<String, Object> iv : resultList) {
      for (Product product : products) {
        if (product.getId().equals(
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.