private void SyncAllCategoriesFeatures() { if (!siteCategoriesFeaturesTable.ContainsKey(apiContext.Site)) { FeaturesDownloader downloader = new FeaturesDownloader(apiContext); GetCategoryFeaturesResponseType resp = downloader.GetCategoryFeatures(); CategoryFeatureTypeCollection cfCol = resp.Category; Hashtable cfsTable = new Hashtable(TABLE_SIZE); foreach (CategoryFeatureType cf in cfCol) { cfsTable.Add(cf.CategoryID, cf); } siteCategoriesFeaturesTable.Add(apiContext.Site, cfsTable); siteFeatureDefaultTable.Add(apiContext.Site, resp.SiteDefaults); siteFeatureDefinitionsTable.Add(apiContext.Site, resp.FeatureDefinitions); } }
public static void GetAllCategoriesFeatures(ApiContext context) { FeaturesDownloader downloader = new FeaturesDownloader(context); GetCategoryFeaturesResponseType resp = downloader.GetCategoryFeatures(); CategoryFeatureTypeCollection cfCol = resp.Category; //cache the features in hashtable foreach (CategoryFeatureType cf in cfCol) { cfsTable.Add(cf.CategoryID, cf); } //cache site defaults siteDefaults = resp.SiteDefaults; //cahce feature definitions featureDefinition = resp.FeatureDefinitions; }
/// <summary> /// Get features for a specific category ID /// </summary> /// <param name="CategoryID">Any CategoryID</param> public static void GetCategoryFeaturesRequest(string CategoryID) { eBayAPIInterfaceService service = EbayCalls.eBayServiceCall("GetCategoryFeatures"); GetCategoryFeaturesRequestType request = new GetCategoryFeaturesRequestType(); request.Version = "949"; request.WarningLevel = WarningLevelCodeType.High; request.CategoryID = CategoryID; request.FeatureID = new FeatureIDCodeTypeCollection { FeatureIDCodeType.ConditionValues, FeatureIDCodeType.ListingDurations, FeatureIDCodeType.HandlingTimeEnabled, FeatureIDCodeType.MaxFlatShippingCost, FeatureIDCodeType.PayPalRequired, FeatureIDCodeType.BestOfferEnabled, FeatureIDCodeType.ReturnPolicyEnabled }; request.DetailLevel = new DetailLevelCodeTypeCollection { DetailLevelCodeType.ReturnAll }; GetCategoryFeaturesResponseType response = service.GetCategoryFeatures(request); Console.WriteLine("====================================="); Console.WriteLine("Category Features"); Console.WriteLine("====================================="); Console.WriteLine("Ack: {0}", response.Ack); Console.WriteLine("Version: {0}", response.Version); Console.WriteLine("Build: {0}", response.Build); Console.WriteLine("Category Version: {0}", response.CategoryVersion); Console.WriteLine("Update Time: {0}", response.UpdateTime); Console.WriteLine("Return Policy Enabled: {0}", response.SiteDefaults.ReturnPolicyEnabled); Console.WriteLine("PayPal Required: {0}", response.SiteDefaults.PayPalRequired); // ... }