Пример #1
0
        public void GetItem()
        {
            bool     includeCrossPromotion = true;
            bool     includeItemSpecifics  = true;
            bool     includeTaxTable       = false;
            bool     includeWatchCount     = true;
            ItemType item = null;

            Assert.IsNotNull(TestData.NewItem2, "Failed because no item available -- requires successful AddItem test");

            GetItemCall api = new GetItemCall(this.apiContext);

            api.IncludeCrossPromotion = includeCrossPromotion;
            api.IncludeItemSpecifics  = includeItemSpecifics;
            api.IncludeTaxTable       = includeTaxTable;
            api.IncludeWatchCount     = includeWatchCount;
            api.ItemID = TestData.NewItem2.ItemID;
            api.Execute();

            //check whether the call is success.
            Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!");
            Assert.IsNotNull(api.ApiResponse.Item);
            item = api.ApiResponse.Item;
            Assert.IsTrue(item.ItemSpecifics.Count > 0, "this is no item spcifics");
            Assert.IsTrue(item.WatchCount >= 0);
        }
Пример #2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            credencialesEbay.cuenta = "ofertasparati";
            GetItemCall getItemcall = new GetItemCall(credencialesEbay.context);

            getItemcall.ItemID = "272416907107";
            getItemcall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);
            getItemcall.IncludeItemSpecifics = true;
            getItemcall.Execute();
            ItemType          item = getItemcall.ApiResponse.Item;
            NameValueListType i    = item.Variations.VariationSpecificsSet.ItemAt(0);
            //item.SKU = "pepe";
            //ReviseItemCall RIC = new ReviseItemCall(credencialesEbay.context);
            //RIC.Item = item;
            //RIC.Execute();
            //ReviseFixedPriceItemCall RI = new ReviseFixedPriceItemCall(credencialesEbay.context);
            //RI.Item = item;
            //RI.Execute();
        }
Пример #3
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("+++++++++++++++++++++++++++++++++++++++");
                Console.WriteLine("+ Welcome to eBay SDK for .Net Sample +");
                Console.WriteLine("+ - ConsoleGetItemUsingOAuth      +");
                Console.WriteLine("+++++++++++++++++++++++++++++++++++++++");

                //Initialize eBay ApiContext object
                ApiContext apiContext = GetApiContext();


                //Create Call object and execute the Call
                GetItemCall apiCall = new GetItemCall(apiContext);
                apiCall.ItemID = ConfigurationManager.AppSettings["ItemID"].ToString();
                apiCall.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);
                apiCall.Execute();
                Console.WriteLine("Begin to call eBay API, please wait ...");

                Console.WriteLine("End to call eBay API, show call result ...");
                Console.WriteLine();

                //Handle the result returned
                Console.WriteLine("ItemID: " + apiCall.Item.ItemID.ToString());
                Console.WriteLine();
                Console.WriteLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Failed to get user data : " + ex.Message);
            }

            Console.WriteLine();
            Console.WriteLine("Press any key to close the program.");
            Console.ReadKey();
        }