Examples of ReviseSellingManagerProductResponseType


Examples of com.ebay.soap.eBLBaseComponents.ReviseSellingManagerProductResponseType

    public static boolean updateProductInEbayInventoryFolder(DispatchContext dctx, Map<String,Object> context) {
        GenericValue userLogin = (GenericValue) context.get("userLogin");
        Locale locale = (Locale) context.get("locale");
        Delegator delegator = dctx.getDelegator();
        ReviseSellingManagerProductRequestType req = null;
        ReviseSellingManagerProductResponseType resp = null;
        boolean flag = false;

        try {
            if (context.get("productStoreId") != null && context.get("productId") != null && context.get("folderId") != null) {
                String productId = (String)context.get("productId");
                String folderId = (String)context.get("folderId");
                ReviseSellingManagerProductCall call = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
                req = new ReviseSellingManagerProductRequestType();
                SellingManagerProductDetailsType  sellingManagerProductDetailsType = new SellingManagerProductDetailsType();
                GenericValue ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId")));
                Long ebayProductId = null;
                if (ebayProductStoreInventory != null && ebayProductStoreInventory.getLong("ebayProductId") == null) {
                    Debug.logError("Can not update product "+productId+" has no ebay product Id in EbayProductStoreInventory. ", module);
                    return flag;
                }
                if (ebayProductStoreInventory != null && ebayProductStoreInventory.getLong("ebayProductId") != null) {
                    ebayProductId = ebayProductStoreInventory.getLong("ebayProductId");
                }
                sellingManagerProductDetailsType.setProductID(ebayProductId);

                sellingManagerProductDetailsType.setProductName((delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId))).getString("internalName"));
                //Must keep productId in SKU NUMBER because ebay allow productId field only long value.
                sellingManagerProductDetailsType.setCustomLabel(productId);
                if (ebayProductStoreInventory!=null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue());

                req.setSellingManagerProductDetails(sellingManagerProductDetailsType);
                resp = (ReviseSellingManagerProductResponseType) call.execute(req);
                if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
                    flag = true;
                    ebayProductStoreInventory.put("ebayProductId", ebayProductId);
                    ebayProductStoreInventory.put("folderId", folderId);
                    ebayProductStoreInventory.store();
                } else {
                    EbayStoreHelper.createErrorLogMessage(userLogin, dctx.getDispatcher(), context.get("productStoreId").toString(), resp.getAck().toString(), "ReviseSellingManagerProductCall : updateProductInEbayInventoryFolder", resp.getErrors(0).getLongMessage());
                    Debug.logError("Fail to  update inventory product ".concat(productId).concat("in productStore ").concat(context.get("productStoreId").toString()).concat(" message from ebay : ").concat(resp.getMessage()), module);
                }
            }
        } catch (ApiException e) {
            Debug.logError(e.getMessage(), module);
        } catch (SdkSoapException e) {
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.ReviseSellingManagerProductResponseType

                            if (qty > 0) {
                                int newQty = qty - 1;
                                prodDetailType.setQuantityAvailable(newQty);
                                ReviseSellingManagerProductCall revProdCall = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext(productStoreId, locale, delegator));
                                ReviseSellingManagerProductRequestType revReq = new ReviseSellingManagerProductRequestType();
                                ReviseSellingManagerProductResponseType revResp = null;
                                revReq.setSellingManagerProductDetails(prodDetailType);
                                revResp = (ReviseSellingManagerProductResponseType) revProdCall.execute(revReq);
                                if (revResp != null && "SUCCESS".equals(revResp.getAck().toString())) {
                                    Debug.logInfo("  Already update quantity on eBay inventory with product id ::"+revResp.getSellingManagerProductDetails().getProductID(), module);
                                } else {
                                    EbayStoreHelper.createErrorLogMessage(userLogin, dispatcher, productStoreId, revResp.getAck().toString(), "ReviseSellingManagerProductCall : updateQuantityInventoryProduct", revResp.getErrors(0).getLongMessage());
                                }
                            }
                        }
                    }
                } else {
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.ReviseSellingManagerProductResponseType

                            if (qty > 0) {
                                int newQty = qty - 1;
                                prodDetailType.setQuantityAvailable(newQty);
                                ReviseSellingManagerProductCall revProdCall = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext(productStoreId, locale, delegator));
                                ReviseSellingManagerProductRequestType revReq = new ReviseSellingManagerProductRequestType();
                                ReviseSellingManagerProductResponseType revResp = null;
                                revReq.setSellingManagerProductDetails(prodDetailType);
                                revResp = (ReviseSellingManagerProductResponseType) revProdCall.execute(revReq);
                                if (revResp != null && "SUCCESS".equals(revResp.getAck().toString())) {
                                    Debug.log("  Already update quantity on eBay inventory with product id ::"+revResp.getSellingManagerProductDetails().getProductID());
                                } else {
                                    EbayStoreHelper.createErrorLogMessage(userLogin, dispatcher, productStoreId, revResp.getAck().toString(), "ReviseSellingManagerProductCall : updateQuantityInventoryProduct", revResp.getErrors(0).getLongMessage());
                                }
                            }
                        }
                    }
                } else {
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.ReviseSellingManagerProductResponseType

                            if (qty > 0) {
                                int newQty = qty - 1;
                                prodDetailType.setQuantityAvailable(newQty);
                                ReviseSellingManagerProductCall revProdCall = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext(productStoreId, locale, delegator));
                                ReviseSellingManagerProductRequestType revReq = new ReviseSellingManagerProductRequestType();
                                ReviseSellingManagerProductResponseType revResp = null;
                                revReq.setSellingManagerProductDetails(prodDetailType);
                                revResp = (ReviseSellingManagerProductResponseType) revProdCall.execute(revReq);
                                if (revResp != null && "SUCCESS".equals(revResp.getAck().toString())) {
                                    Debug.logInfo("  Already update quantity on eBay inventory with product id ::"+revResp.getSellingManagerProductDetails().getProductID(), module);
                                } else {
                                    EbayStoreHelper.createErrorLogMessage(userLogin, dispatcher, productStoreId, revResp.getAck().toString(), "ReviseSellingManagerProductCall : updateQuantityInventoryProduct", revResp.getErrors(0).getLongMessage());
                                }
                            }
                        }
                    }
                } else {
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.ReviseSellingManagerProductResponseType

                            if (qty > 0) {
                                int newQty = qty - 1;
                                prodDetailType.setQuantityAvailable(newQty);
                                ReviseSellingManagerProductCall revProdCall = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext(productStoreId, locale, delegator));
                                ReviseSellingManagerProductRequestType revReq = new ReviseSellingManagerProductRequestType();
                                ReviseSellingManagerProductResponseType revResp = null;
                                revReq.setSellingManagerProductDetails(prodDetailType);
                                revResp = (ReviseSellingManagerProductResponseType) revProdCall.execute(revReq);
                                if (revResp != null && "SUCCESS".equals(revResp.getAck().toString())) {
                                    Debug.log("  Already update quantity on eBay inventory with product id ::"+revResp.getSellingManagerProductDetails().getProductID());
                                } else {
                                    EbayStoreHelper.createErrorLogMessage(userLogin, dispatcher, productStoreId, revResp.getAck().toString(), "ReviseSellingManagerProductCall : updateQuantityInventoryProduct", revResp.getErrors(0).getLongMessage());
                                }
                            }
                        }
                    }
                } else {
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.ReviseSellingManagerProductResponseType

    public static boolean updateProductInEbayInventoryFolder(DispatchContext dctx, Map<String,Object> context) {
        GenericValue userLogin = (GenericValue) context.get("userLogin");
        Locale locale = (Locale) context.get("locale");
        Delegator delegator = dctx.getDelegator();
        ReviseSellingManagerProductRequestType req = null;
        ReviseSellingManagerProductResponseType resp = null;
        boolean flag = false;

        try {
            if (context.get("productStoreId") != null && context.get("productId") != null && context.get("folderId") != null) {
                String productId = (String)context.get("productId");
                String folderId = (String)context.get("folderId");
                ReviseSellingManagerProductCall call = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
                req = new ReviseSellingManagerProductRequestType();
                SellingManagerProductDetailsType  sellingManagerProductDetailsType = new SellingManagerProductDetailsType();
                GenericValue ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId")));
                Long ebayProductId = null;
                if (ebayProductStoreInventory != null && ebayProductStoreInventory.getLong("ebayProductId") == null) {
                    Debug.logError("Can not update product "+productId+" has no ebay product Id in EbayProductStoreInventory. ", module);
                    return flag;
                }
                if (ebayProductStoreInventory != null && ebayProductStoreInventory.getLong("ebayProductId") != null) {
                    ebayProductId = ebayProductStoreInventory.getLong("ebayProductId");
                }
                sellingManagerProductDetailsType.setProductID(ebayProductId);

                sellingManagerProductDetailsType.setProductName((delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId))).getString("internalName"));
                //Must keep productId in SKU NUMBER because ebay allow productId field only long value.
                sellingManagerProductDetailsType.setCustomLabel(productId);
                if (ebayProductStoreInventory!=null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue());

                req.setSellingManagerProductDetails(sellingManagerProductDetailsType);
                resp = (ReviseSellingManagerProductResponseType) call.execute(req);
                if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
                    flag = true;
                    ebayProductStoreInventory.put("ebayProductId", ebayProductId);
                    ebayProductStoreInventory.put("folderId", folderId);
                    ebayProductStoreInventory.store();
                } else {
                    EbayStoreHelper.createErrorLogMessage(userLogin, dctx.getDispatcher(), context.get("productStoreId").toString(), resp.getAck().toString(), "ReviseSellingManagerProductCall : updateProductInEbayInventoryFolder", resp.getErrors(0).getLongMessage());
                    Debug.logError("Fail to  update inventory product ".concat(productId).concat("in productStore ").concat(context.get("productStoreId").toString()).concat(" message from ebay : ").concat(resp.getMessage()), module);
                }
            }
        } catch (ApiException e) {
            Debug.logError(e.getMessage(), module);
        } catch (SdkSoapException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.