Esempio n. 1
0
        public ListInventorySupplyResponse InvokeListInventorySupply()
        {
            // Create a request.
            ListInventorySupplyRequest request = new ListInventorySupplyRequest();
            string sellerId = "example";

            request.SellerId = sellerId;
            string mwsAuthToken = "example";

            request.MWSAuthToken = mwsAuthToken;
            string marketplace = "example";

            request.Marketplace = marketplace;
            string marketplaceId = "example";

            request.MarketplaceId = marketplaceId;
            SellerSkuList sellerSkus = new SellerSkuList();

            request.SellerSkus = sellerSkus;
            DateTime queryStartDateTime = new DateTime();

            request.QueryStartDateTime = queryStartDateTime;
            string responseGroup = "example";

            request.ResponseGroup = responseGroup;
            return(this.client.ListInventorySupply(request));
        }
Esempio n. 2
0
        public List <InventorySupply> GetInventorySupply(List <string> skus)
        {
            try
            {
                ListInventorySupplyRequest request = new ListInventorySupplyRequest();
                request.WithSellerSkus(new SellerSkuList().Withmember(skus.ToArray()));
                request.SellerId    = m_sellerId;
                request.Marketplace = m_marketPlaceId;

                ListInventorySupplyResponse response = m_service.ListInventorySupply(request);
                if (response.IsSetListInventorySupplyResult())
                {
                    ListInventorySupplyResult listInventorySupplyResult = response.ListInventorySupplyResult;
                    if (listInventorySupplyResult.IsSetInventorySupplyList())
                    {
                        InventorySupplyList    inventorySupplyList = listInventorySupplyResult.InventorySupplyList;
                        List <InventorySupply> memberList          = inventorySupplyList.member;
                        return(memberList);
                    }
                }
            }
            catch (FBAInventoryServiceMWSException ex)
            {
                Console.WriteLine("Caught Exception: " + ex.Message);
                Console.WriteLine("Response Status Code: " + ex.StatusCode);
                Console.WriteLine("Error Code: " + ex.ErrorCode);
                Console.WriteLine("Error Type: " + ex.ErrorType);
                Console.WriteLine("Request ID: " + ex.RequestId);
                Console.WriteLine("XML: " + ex.XML);
            }

            return(new List <InventorySupply>());
        }
Esempio n. 3
0
        /**
         * Convert ListInventorySupplyRequest to name value pairs
         */
        private IDictionary <String, String> ConvertListInventorySupply(ListInventorySupplyRequest request)
        {
            IDictionary <String, String> parameters = new Dictionary <String, String>();

            parameters.Add("Action", "ListInventorySupply");
            if (request.IsSetSellerId())
            {
                parameters.Add("SellerId", request.SellerId);
            }
            if (request.IsSetMarketplace())
            {
                parameters.Add("Marketplace", request.Marketplace);
            }
            if (request.IsSetSellerSkus())
            {
                SellerSkuList listInventorySupplyRequestSellerSkus = request.SellerSkus;
                List <String> sellerSkusmemberList      = listInventorySupplyRequestSellerSkus.member;
                int           sellerSkusmemberListIndex = 1;
                foreach (String sellerSkusmember in sellerSkusmemberList)
                {
                    parameters.Add("SellerSkus" + "." + "member" + "." + sellerSkusmemberListIndex, sellerSkusmember);
                    sellerSkusmemberListIndex++;
                }
            }
            if (request.IsSetQueryStartDateTime())
            {
                parameters.Add("QueryStartDateTime", GetFormattedTimestamp(request.QueryStartDateTime) + "");
            }
            if (request.IsSetResponseGroup())
            {
                parameters.Add("ResponseGroup", request.ResponseGroup);
            }

            return(parameters);
        }
Esempio n. 4
0
        public ListInventorySupplyResponse InvokeListInventorySupply()
        {
            // Create a request.
            ListInventorySupplyRequest request = new ListInventorySupplyRequest();

            request.SellerId     = sellerId;
            request.MWSAuthToken = mwsAuthToken;
            //request.Marketplace = marketplace;
            request.MarketplaceId = shopMarketplaceId;
            SellerSkuList sellerSkus = new SellerSkuList();

            request.SellerSkus         = sellerSkus;
            request.QueryStartDateTime = inventoryQueryStartDateTime.Value;
            //request.ResponseGroup = responseGroup;
            return(this.client.ListInventorySupply(request));
        }
        public DataSet GetSellerInventorySupplyList()
        {
            DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "GetSellerInventorySupplyList() started.");
            ListInventorySupplyRequest request = new ListInventorySupplyRequest();

            // @TODO: set request parameters here
            request.SellerId           = sellerId;
            request.Marketplace        = marketplaceId;
            request.ResponseGroup      = "Detailed";
            request.QueryStartDateTime = DateTime.Today;
            DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "GetSellerInventorySupplyList() request date:" + request.QueryStartDateTime.ToString());
            ListInventorySupplyHandler getSupplyHandler = new ListInventorySupplyHandler();

            DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "GetSellerInventorySupplyList() InvokeListInventorySupply");
            InventorySupplyList = getSupplyHandler.InvokeListInventorySupply(service, request);
            return(InventorySupplyList);
        }
Esempio n. 6
0
 /// <summary>
 /// List Inventory Supply
 /// </summary>
 /// <param name="request">List Inventory Supply  request</param>
 /// <returns>List Inventory Supply  Response from the service</returns>
 /// <remarks>
 /// Get information about the supply of seller-owned inventory in
 /// Amazon's fulfillment network. "Supply" is inventory that is available
 /// for fulfilling (a.k.a. Multi-Channel Fulfillment) orders. In general
 /// this includes all sellable inventory that has been received by Amazon,
 /// that is not reserved for existing orders or for internal FC processes,
 /// and also inventory expected to be received from inbound shipments.
 /// This operation provides 2 typical usages by setting different
 /// ListInventorySupplyRequest value:
 ///
 /// 1. Set value to SellerSkus and not set value to QueryStartDateTime,
 /// this operation will return all sellable inventory that has been received
 /// by Amazon's fulfillment network for these SellerSkus.
 /// 2. Not set value to SellerSkus and set value to QueryStartDateTime,
 /// This operation will return information about the supply of all seller-owned
 /// inventory in Amazon's fulfillment network, for inventory items that may have had
 /// recent changes in inventory levels. It provides the most efficient mechanism
 /// for clients to maintain local copies of inventory supply data.
 /// Only 1 of these 2 parameters (SellerSkus and QueryStartDateTime) can be set value for 1 request.
 /// If both with values or neither with values, an exception will be thrown.
 /// This operation is used with ListInventorySupplyByNextToken
 /// to paginate over the resultset. Begin pagination by invoking the
 /// ListInventorySupply operation, and retrieve the first set of
 /// results. If more results are available,continuing iteratively requesting further
 /// pages results by invoking the ListInventorySupplyByNextToken operation (each time
 /// passing in the NextToken value from the previous result), until the returned NextToken
 /// is null, indicating no further results are available.
 ///
 /// </remarks>
 public ListInventorySupplyResponse ListInventorySupply(ListInventorySupplyRequest request)
 {
     return(Invoke <ListInventorySupplyResponse>("ListInventorySupplyResponse.xml"));
 }
Esempio n. 7
0
 public ListInventorySupplyResponse ListInventorySupply(ListInventorySupplyRequest request)
 {
     return(connection.Call(
                new FBAInventoryServiceMWSClient.Request <ListInventorySupplyResponse>("ListInventorySupply", typeof(ListInventorySupplyResponse), servicePath),
                request));
 }
        /// <summary>
        /// Get Next Inventory List Supply
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnListInventorySupplyByNextToken_Click(object sender, RoutedEventArgs e)
        {
            string SellerId           = CommonValue.strMerchantId;
            string MarketplaceId      = CommonValue.strMarketplaceId;
            string AccessKeyId        = CommonValue.strAccessKeyId;
            string SecretKeyId        = CommonValue.strSecretKeyId;
            string ApplicationVersion = CommonValue.strApplicationVersion;
            string ApplicationName    = CommonValue.strApplicationName;
            string MWSAuthToken       = CommonValue.strMWSAuthToken;
            string strbuff            = string.Empty;

            FBAInventoryServiceMWSConfig config = new FBAInventoryServiceMWSConfig();

            config.ServiceURL = CommonValue.strServiceURL;

            FBAInventoryServiceMWSClient client = new FBAInventoryServiceMWSClient(
                AccessKeyId,
                SecretKeyId,
                ApplicationName,
                ApplicationVersion,
                config);
            ListInventorySupplyRequest request = new ListInventorySupplyRequest();

            request.SellerId           = SellerId;
            request.Marketplace        = MarketplaceId;
            request.MWSAuthToken       = MWSAuthToken;
            request.QueryStartDateTime = DateTime.Now.AddMonths(1);
            request.ResponseGroup      = "Detailed";

            ListInventorySupplyResponse response = client.ListInventorySupply(request);

            if (response.IsSetListInventorySupplyResult())
            {
                ListInventorySupplyResult listInventorySupplyResult = response.ListInventorySupplyResult;
                if (listInventorySupplyResult.IsSetInventorySupplyList())
                {
                    if (listInventorySupplyResult.NextToken != null)
                    {
                        ListInventorySupplyByNextTokenRequest request1 = new ListInventorySupplyByNextTokenRequest();
                        request1.SellerId     = SellerId;
                        request1.Marketplace  = MarketplaceId;
                        request1.MWSAuthToken = MWSAuthToken;
                        request1.NextToken    = listInventorySupplyResult.NextToken;

                        ListInventorySupplyByNextTokenResponse response1 = client.ListInventorySupplyByNextToken(request1);
                        if (response1.IsSetListInventorySupplyByNextTokenResult())
                        {
                            ListInventorySupplyByNextTokenResult listInventorySupplyByNextTokenResult = response1.ListInventorySupplyByNextTokenResult;
                            if (listInventorySupplyByNextTokenResult.IsSetInventorySupplyList())
                            {
                                InventorySupplyList    inventorySupplyList = listInventorySupplyByNextTokenResult.InventorySupplyList;
                                List <InventorySupply> memberList          = inventorySupplyList.member;
                                if (memberList.Count > 0)
                                {
                                    foreach (InventorySupply member in memberList)
                                    {
                                        if (member.IsSetTotalSupplyQuantity())
                                        {
                                            strbuff += "Amount:" + member.TotalSupplyQuantity;
                                        }
                                    }
                                }
                                else
                                {
                                    strbuff = "Not find next stock information.";
                                }
                            }
                        }
                    }
                }
            }
            txtListInventorySupplyByNextToken.Text = strbuff;
        }
        /**
         * Samples for FBA Inventory Service MWS functionality
         */
        public static void Main(string [] args)
        {
            Console.WriteLine("===========================================");
            Console.WriteLine("Welcome to FBA Inventory Service MWS Samples!");
            Console.WriteLine("===========================================");

            Console.WriteLine("To get started:");
            Console.WriteLine("===========================================");
            Console.WriteLine("  - Fill in your MWS credentials");
            Console.WriteLine("  - Uncomment sample you're interested in trying");
            Console.WriteLine("  - Set request with desired parameters");
            Console.WriteLine("  - Hit F5 to run!");
            Console.WriteLine();

            Console.WriteLine("===========================================");
            Console.WriteLine("Samples Output");
            Console.WriteLine("===========================================");
            Console.WriteLine();

            /************************************************************************
             * Access Key ID and Secret Acess Key ID, obtained from:
             * http://mws.amazon.com
             ***********************************************************************/
            String accessKeyId     = "AKIAJ2IS6ZEEGQPJV7WA";
            String secretAccessKey = "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";

            /************************************************************************
             * Marketplace and Seller IDs are required parameters for all
             * MWS calls.
             ***********************************************************************/
            const string marketplaceId = "ATVPDKIKX0DER";
            const string sellerId      = "A2TYS339AQK0NU";

            /************************************************************************
             * The application name and version are included in each MWS call's
             * HTTP User-Agent field. These are required fields.
             ***********************************************************************/
            const string applicationName    = "<Your Application Name>";
            const string applicationVersion = "<Your Application Version or Build Number or Release Date>";

            /************************************************************************
             * Uncomment to try advanced configuration options. Available options are:
             *
             *  - Proxy Host and Proxy Port
             *  - MWS Service endpoint URL
             *  - User Agent String to be sent to FBA Inventory Service MWS  service
             *
             ***********************************************************************/
            FBAInventoryServiceMWSConfig config = new FBAInventoryServiceMWSConfig();

            //config.ProxyHost = "https://PROXY_URL";
            //config.ProxyPort = 9090;
            //
            // IMPORTANT: Uncomment out the appropiate line for the country you wish
            // to sell in:
            //
            // US
            config.ServiceURL = "https://mws.amazonservices.com/FulfillmentInventory/2010-10-01/";
            // UK
            // config.ServiceURL = "https://mws.amazonservices.co.uk/FulfillmentInventory/2010-10-01/";
            // Germany
            // config.ServiceURL = "https://mws.amazonservices.de/FulfillmentInventory/2010-10-01/";
            // France
            // config.ServiceURL = "https://mws.amazonservices.fr/FulfillmentInventory/2010-10-01/";
            // Japan
            // config.ServiceURL = "https://mws.amazonservices.jp/FulfillmentInventory/2010-10-01/";
            // China
            // config.ServiceURL = "https://mws.amazonservices.com.cn/FulfillmentInventory/2010-10-01/";

            // ProxyPort=-1 ; MaxErrorRetry=3
            config.SetUserAgentHeader(
                applicationName,
                applicationVersion,
                "C#",
                "-1", "3");

            /************************************************************************
             * Instantiate Implementation of FBA Inventory Service MWS
             ***********************************************************************/
            FBAInventoryServiceMWS service =
                new FBAInventoryServiceMWSClient(
                    accessKeyId,
                    secretAccessKey,
                    applicationName,
                    applicationVersion,
                    config);

            // FBAInventoryServiceMWS service = new FBAInventoryServiceMWSClient(accessKeyId, secretAccessKey, config);

            /************************************************************************
             * Uncomment to try out Mock Service that simulates FBA Inventory Service MWS
             * responses without calling FBA Inventory Service MWS  service.
             *
             * Responses are loaded from local XML files. You can tweak XML files to
             * experiment with various outputs during development
             *
             * XML files available under FBAInventoryServiceMWS\Mock tree
             *
             ***********************************************************************/
            // FBAInventoryServiceMWS service = new FBAInventoryServiceMWSMock();

            /************************************************************************
             * Uncomment to invoke List Inventory Supply By Next Token Action
             ***********************************************************************/
            // ListInventorySupplyByNextTokenRequest request = new ListInventorySupplyByNextTokenRequest();
            // @TODO: set request parameters here
            // request.SellerId = sellerId;
            // request.Marketplace = marketplaceId;

            // ListInventorySupplyByNextTokenSample.InvokeListInventorySupplyByNextToken(service, request);

            /************************************************************************
             * Uncomment to invoke List Inventory Supply Action
             ***********************************************************************/
            ListInventorySupplyRequest request = new ListInventorySupplyRequest();

            // @TODO: set request parameters here
            request.SellerId    = sellerId;
            request.Marketplace = marketplaceId;

            request.QueryStartDateTime = DateTime.Parse("2014-06-15");
            ListInventorySupplySample.InvokeListInventorySupply(service, request);

            /************************************************************************
             * Uncomment to invoke Get Service Status Action
             ***********************************************************************/
            // GetServiceStatusRequest request = new GetServiceStatusRequest();
            // @TODO: set request parameters here
            // request.SellerId = sellerId;
            // request.Marketplace = marketplaceId;

            // GetServiceStatusSample.InvokeGetServiceStatus(service, request);
            Console.WriteLine();
            Console.WriteLine("===========================================");
            Console.WriteLine("End of output. You can close this window");
            Console.WriteLine("===========================================");

            System.Threading.Thread.Sleep(50000);
        }
        public DataSet InvokeListInventorySupply(FBAInventoryServiceMWS.FBAInventoryServiceMWS service, ListInventorySupplyRequest request)
        {
            try
            {
                ListInventorySupplyResponse response = service.ListInventorySupply(request);
                DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "InvokeListInventorySupply() reponse:" + response.ToXML());
                if (response.IsSetListInventorySupplyResult())
                {
                    ListInventorySupplyResult listInventorySupplyResult = response.ListInventorySupplyResult;
                    if (listInventorySupplyResult.IsSetInventorySupplyList())
                    {
                        InventorySupplyList    inventorySupplyList = listInventorySupplyResult.InventorySupplyList;
                        List <InventorySupply> memberList          = inventorySupplyList.member;
                        foreach (InventorySupply member in memberList)
                        {
                            int InboundCount  = 0;
                            int InStockCount  = 0;
                            int TransferCount = 0;
                            //Console.WriteLine("                    member");
                            DataRow InventoryRow = InventorySupplyTable.NewRow();
                            InventoryRow["FNSKU"]     = "N/A";
                            InventoryRow["SellerSKU"] = "N/A";
                            InventoryRow["ASIN"]      = "N/A";
                            InventoryRow["Inbound"]   = InboundCount;
                            InventoryRow["InStock"]   = InStockCount;
                            InventoryRow["Transfer"]  = TransferCount;
                            if (member.IsSetSellerSKU())
                            {
                                InventoryRow["SellerSKU"] = member.SellerSKU;
                                //Console.WriteLine("                        SellerSKU");
                                //Console.WriteLine("                            {0}", member.SellerSKU);
                            }
                            if (member.IsSetFNSKU())
                            {
                                InventoryRow["FNSKU"] = member.FNSKU;
                                //Console.WriteLine("                        FNSKU");
                                //Console.WriteLine("                            {0}", member.FNSKU);
                            }
                            if (member.IsSetASIN())
                            {
                                InventoryRow["ASIN"] = member.ASIN;
                                //Console.WriteLine("                        ASIN");
                                // Console.WriteLine("                            {0}", member.ASIN);
                            }
                            if (member.IsSetCondition())
                            {
                                //Console.WriteLine("                        Condition");
                                //Console.WriteLine("                            {0}", member.Condition);
                            }
                            if (member.IsSetTotalSupplyQuantity())
                            {
                                //InventoryRow["TotalSupplyQuantity"] = member.TotalSupplyQuantity;
                                //Console.WriteLine("                        TotalSupplyQuantity");
                                //Console.WriteLine("                            {0}", member.TotalSupplyQuantity);
                            }
                            if (member.IsSetInStockSupplyQuantity())
                            {
                                //InventoryRow["InStockSupplyQuantity"] = member.InStockSupplyQuantity;
                                //Console.WriteLine("                        InStockSupplyQuantity");
                                //Console.WriteLine("                            {0}", member.InStockSupplyQuantity);
                            }
                            if (member.IsSetEarliestAvailability())
                            {
                                //Console.WriteLine("                        EarliestAvailability");
                                Timepoint earliestAvailability = member.EarliestAvailability;
                                if (earliestAvailability.IsSetTimepointType())
                                {
                                    //Console.WriteLine("                            TimepointType");
                                    //Console.WriteLine("                                {0}", earliestAvailability.TimepointType);
                                }
                                if (earliestAvailability.IsSetDateTime())
                                {
                                    //Console.WriteLine("                            DateTime");
                                    //Console.WriteLine("                                {0}", earliestAvailability.DateTime);
                                }
                            }
                            if (member.IsSetSupplyDetail())
                            {
                                //Console.WriteLine("                        SupplyDetail");
                                InventorySupplyDetailList    supplyDetail = member.SupplyDetail;
                                List <InventorySupplyDetail> member1List  = supplyDetail.member;
                                foreach (InventorySupplyDetail member1 in member1List)
                                {
                                    //Console.WriteLine("                            member");
                                    if (member1.IsSetQuantity())
                                    {
                                        if (member1.SupplyType == "InStock")
                                        {
                                            InStockCount += Int32.Parse(member1.Quantity.ToString());
                                        }
                                        if (member1.SupplyType == "Inbound")
                                        {
                                            InboundCount += Int32.Parse(member1.Quantity.ToString());
                                        }
                                        if (member1.SupplyType == "Transfer")
                                        {
                                            TransferCount = Int32.Parse(member.TotalSupplyQuantity.ToString()) - Int32.Parse(member1.Quantity.ToString());
                                        }
                                        //InventoryRow[member1.SupplyType] = member1.Quantity;
                                        //Console.WriteLine("                                Quantity");
                                        //Console.WriteLine("                                    {0}", member1.Quantity);
                                    }
                                    if (member1.IsSetSupplyType())
                                    {
                                        //Console.WriteLine("                                SupplyType");
                                        //Console.WriteLine("                                    {0}", member1.SupplyType);
                                    }
                                    if (member1.IsSetEarliestAvailableToPick())
                                    {
                                        //Console.WriteLine("                                EarliestAvailableToPick");
                                        //Timepoint earliestAvailableToPick = member1.EarliestAvailableToPick;
                                        //if (earliestAvailableToPick.IsSetTimepointType())
                                        //{
                                        //    Console.WriteLine("                                    TimepointType");
                                        //    Console.WriteLine("                                        {0}", earliestAvailableToPick.TimepointType);
                                        //}
                                        //if (earliestAvailableToPick.IsSetDateTime())
                                        //{
                                        //    Console.WriteLine("                                    DateTime");
                                        //    Console.WriteLine("                                        {0}", earliestAvailableToPick.DateTime);
                                        //}
                                    }
                                    if (member1.IsSetLatestAvailableToPick())
                                    {
                                        //Console.WriteLine("                                LatestAvailableToPick");
                                        //Timepoint latestAvailableToPick = member1.LatestAvailableToPick;
                                        //if (latestAvailableToPick.IsSetTimepointType())
                                        //{
                                        //    Console.WriteLine("                                    TimepointType");
                                        //    Console.WriteLine("                                        {0}", latestAvailableToPick.TimepointType);
                                        //}
                                        //if (latestAvailableToPick.IsSetDateTime())
                                        //{
                                        //    Console.WriteLine("                                    DateTime");
                                        //    Console.WriteLine("                                        {0}", latestAvailableToPick.DateTime);
                                        //}
                                    }
                                }
                            }//end of foreach member1 list

                            InventoryRow["Inbound"]  = InboundCount;
                            InventoryRow["InStock"]  = InStockCount;
                            InventoryRow["Transfer"] = TransferCount;

                            InventorySupplyTable.Rows.Add(InventoryRow);
                        } // end of foreach member list
                    }
                    if (listInventorySupplyResult.IsSetNextToken())
                    {
                        //Console.WriteLine("                NextToken");
                        //Console.WriteLine("                    {0}", listInventorySupplyResult.NextToken);
                        ListInventorySupplyByNextTokenRequest nextTokenRequest = new ListInventorySupplyByNextTokenRequest();
                        nextTokenRequest.SellerId    = request.SellerId;
                        nextTokenRequest.Marketplace = request.Marketplace;
                        nextTokenRequest.NextToken   = listInventorySupplyResult.NextToken;
                        InvokeListInventorySupplyByNextToken(service, nextTokenRequest);
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    Console.WriteLine("            ResponseMetadata");
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                        //Console.WriteLine("                RequestId");
                        //Console.WriteLine("                    {0}", responseMetadata.RequestId);
                    }
                }
            }
            catch (FBAInventoryServiceMWSException ex)
            {
                Console.WriteLine("Caught Exception: " + ex.Message);
                Console.WriteLine("Response Status Code: " + ex.StatusCode);
                Console.WriteLine("Error Code: " + ex.ErrorCode);
                Console.WriteLine("Error Type: " + ex.ErrorType);
                Console.WriteLine("Request ID: " + ex.RequestId);
                Console.WriteLine("XML: " + ex.XML);
                DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "Caught Exception: " + ex.Message);
                DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "Response Status Code: " + ex.StatusCode);
                DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "Error Code: " + ex.ErrorCode);
                DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "Error Type: " + ex.ErrorType);
                DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "Request ID: " + ex.RequestId);
                DebugLogHandler.DebugLogHandler.WriteLog(_sLogPath, _sClass, "XML: " + ex.XML);
            }

            return(InventorySupplyDataSet);
        }
Esempio n. 11
0
 /// <summary>
 /// List Inventory Supply
 /// </summary>
 /// <param name="request">List Inventory Supply  request</param>
 /// <returns>List Inventory Supply  Response from the service</returns>
 /// <remarks>
 /// Get information about the supply of seller-owned inventory in
 /// Amazon's fulfillment network. "Supply" is inventory that is available
 /// for fulfilling (a.k.a. Multi-Channel Fulfillment) orders. In general
 /// this includes all sellable inventory that has been received by Amazon,
 /// that is not reserved for existing orders or for internal FC processes,
 /// and also inventory expected to be received from inbound shipments.
 /// This operation provides 2 typical usages by setting different
 /// ListInventorySupplyRequest value:
 ///
 /// 1. Set value to SellerSkus and not set value to QueryStartDateTime,
 /// this operation will return all sellable inventory that has been received
 /// by Amazon's fulfillment network for these SellerSkus.
 /// 2. Not set value to SellerSkus and set value to QueryStartDateTime,
 /// This operation will return information about the supply of all seller-owned
 /// inventory in Amazon's fulfillment network, for inventory items that may have had
 /// recent changes in inventory levels. It provides the most efficient mechanism
 /// for clients to maintain local copies of inventory supply data.
 /// Only 1 of these 2 parameters (SellerSkus and QueryStartDateTime) can be set value for 1 request.
 /// If both with values or neither with values, an exception will be thrown.
 /// This operation is used with ListInventorySupplyByNextToken
 /// to paginate over the resultset. Begin pagination by invoking the
 /// ListInventorySupply operation, and retrieve the first set of
 /// results. If more results are available,continuing iteratively requesting further
 /// pages results by invoking the ListInventorySupplyByNextToken operation (each time
 /// passing in the NextToken value from the previous result), until the returned NextToken
 /// is null, indicating no further results are available.
 ///
 /// </remarks>
 public ListInventorySupplyResponse ListInventorySupply(ListInventorySupplyRequest request)
 {
     return(Invoke <ListInventorySupplyResponse>(ConvertListInventorySupply(request)));
 }
 public ListInventorySupplyResponse ListInventorySupply(ListInventorySupplyRequest request)
 {
     return(newResponse <ListInventorySupplyResponse>());
 }
Esempio n. 13
0
        /// <summary>
        /// Get information about the supply of seller-owned inventory in
        /// Amazon's fulfillment network. "Supply" is inventory that is available
        /// for fulfilling (a.k.a. Multi-Channel Fulfillment) orders. In general
        /// this includes all sellable inventory that has been received by Amazon,
        /// that is not reserved for existing orders or for internal FC processes,
        /// and also inventory expected to be received from inbound shipments.
        /// This operation provides 2 typical usages by setting different
        /// ListInventorySupplyRequest value:
        ///
        /// 1. Set value to SellerSkus and not set value to QueryStartDateTime,
        /// this operation will return all sellable inventory that has been received
        /// by Amazon's fulfillment network for these SellerSkus.
        /// 2. Not set value to SellerSkus and set value to QueryStartDateTime,
        /// This operation will return information about the supply of all seller-owned
        /// inventory in Amazon's fulfillment network, for inventory items that may have had
        /// recent changes in inventory levels. It provides the most efficient mechanism
        /// for clients to maintain local copies of inventory supply data.
        /// Only 1 of these 2 parameters (SellerSkus and QueryStartDateTime) can be set value for 1 request.
        /// If both with values or neither with values, an exception will be thrown.
        /// This operation is used with ListInventorySupplyByNextToken
        /// to paginate over the resultset. Begin pagination by invoking the
        /// ListInventorySupply operation, and retrieve the first set of
        /// results. If more results are available,continuing iteratively requesting further
        /// pages results by invoking the ListInventorySupplyByNextToken operation (each time
        /// passing in the NextToken value from the previous result), until the returned NextToken
        /// is null, indicating no further results are available.
        ///
        /// </summary>
        /// <param name="service">Instance of FBAInventoryServiceMWS service</param>
        /// <param name="request">ListInventorySupplyRequest request</param>
        public static void InvokeListInventorySupply(FBAInventoryServiceMWS service, ListInventorySupplyRequest request)
        {
            try
            {
                ListInventorySupplyResponse response = service.ListInventorySupply(request);


                Console.WriteLine("Service Response");
                Console.WriteLine("=============================================================================");
                Console.WriteLine();

                Console.WriteLine("        ListInventorySupplyResponse");
                if (response.IsSetListInventorySupplyResult())
                {
                    Console.WriteLine("            ListInventorySupplyResult");
                    ListInventorySupplyResult listInventorySupplyResult = response.ListInventorySupplyResult;
                    if (listInventorySupplyResult.IsSetInventorySupplyList())
                    {
                        Console.WriteLine("                InventorySupplyList");
                        InventorySupplyList    inventorySupplyList = listInventorySupplyResult.InventorySupplyList;
                        List <InventorySupply> memberList          = inventorySupplyList.member;
                        foreach (InventorySupply member in memberList)
                        {
                            Console.WriteLine("                    member");
                            if (member.IsSetSellerSKU())
                            {
                                Console.WriteLine("                        SellerSKU");
                                Console.WriteLine("                            {0}", member.SellerSKU);
                            }
                            if (member.IsSetFNSKU())
                            {
                                Console.WriteLine("                        FNSKU");
                                Console.WriteLine("                            {0}", member.FNSKU);
                            }
                            if (member.IsSetASIN())
                            {
                                Console.WriteLine("                        ASIN");
                                Console.WriteLine("                            {0}", member.ASIN);
                            }
                            if (member.IsSetCondition())
                            {
                                Console.WriteLine("                        Condition");
                                Console.WriteLine("                            {0}", member.Condition);
                            }
                            if (member.IsSetTotalSupplyQuantity())
                            {
                                Console.WriteLine("                        TotalSupplyQuantity");
                                Console.WriteLine("                            {0}", member.TotalSupplyQuantity);
                            }
                            if (member.IsSetInStockSupplyQuantity())
                            {
                                Console.WriteLine("                        InStockSupplyQuantity");
                                Console.WriteLine("                            {0}", member.InStockSupplyQuantity);
                            }
                            if (member.IsSetEarliestAvailability())
                            {
                                Console.WriteLine("                        EarliestAvailability");
                                Timepoint earliestAvailability = member.EarliestAvailability;
                                if (earliestAvailability.IsSetTimepointType())
                                {
                                    Console.WriteLine("                            TimepointType");
                                    Console.WriteLine("                                {0}", earliestAvailability.TimepointType);
                                }
                                if (earliestAvailability.IsSetDateTime())
                                {
                                    Console.WriteLine("                            DateTime");
                                    Console.WriteLine("                                {0}", earliestAvailability.DateTime);
                                }
                            }
                            if (member.IsSetSupplyDetail())
                            {
                                Console.WriteLine("                        SupplyDetail");
                                InventorySupplyDetailList    supplyDetail = member.SupplyDetail;
                                List <InventorySupplyDetail> member1List  = supplyDetail.member;
                                foreach (InventorySupplyDetail member1 in member1List)
                                {
                                    Console.WriteLine("                            member");
                                    if (member1.IsSetQuantity())
                                    {
                                        Console.WriteLine("                                Quantity");
                                        Console.WriteLine("                                    {0}", member1.Quantity);
                                    }
                                    if (member1.IsSetSupplyType())
                                    {
                                        Console.WriteLine("                                SupplyType");
                                        Console.WriteLine("                                    {0}", member1.SupplyType);
                                    }
                                    if (member1.IsSetEarliestAvailableToPick())
                                    {
                                        Console.WriteLine("                                EarliestAvailableToPick");
                                        Timepoint earliestAvailableToPick = member1.EarliestAvailableToPick;
                                        if (earliestAvailableToPick.IsSetTimepointType())
                                        {
                                            Console.WriteLine("                                    TimepointType");
                                            Console.WriteLine("                                        {0}", earliestAvailableToPick.TimepointType);
                                        }
                                        if (earliestAvailableToPick.IsSetDateTime())
                                        {
                                            Console.WriteLine("                                    DateTime");
                                            Console.WriteLine("                                        {0}", earliestAvailableToPick.DateTime);
                                        }
                                    }
                                    if (member1.IsSetLatestAvailableToPick())
                                    {
                                        Console.WriteLine("                                LatestAvailableToPick");
                                        Timepoint latestAvailableToPick = member1.LatestAvailableToPick;
                                        if (latestAvailableToPick.IsSetTimepointType())
                                        {
                                            Console.WriteLine("                                    TimepointType");
                                            Console.WriteLine("                                        {0}", latestAvailableToPick.TimepointType);
                                        }
                                        if (latestAvailableToPick.IsSetDateTime())
                                        {
                                            Console.WriteLine("                                    DateTime");
                                            Console.WriteLine("                                        {0}", latestAvailableToPick.DateTime);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (listInventorySupplyResult.IsSetNextToken())
                    {
                        Console.WriteLine("                NextToken");
                        Console.WriteLine("                    {0}", listInventorySupplyResult.NextToken);
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    Console.WriteLine("            ResponseMetadata");
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                        Console.WriteLine("                RequestId");
                        Console.WriteLine("                    {0}", responseMetadata.RequestId);
                    }
                }
            }
            catch (FBAInventoryServiceMWSException ex)
            {
                Console.WriteLine("Caught Exception: " + ex.Message);
                Console.WriteLine("Response Status Code: " + ex.StatusCode);
                Console.WriteLine("Error Code: " + ex.ErrorCode);
                Console.WriteLine("Error Type: " + ex.ErrorType);
                Console.WriteLine("Request ID: " + ex.RequestId);
                Console.WriteLine("XML: " + ex.XML);
            }
        }