question

eoutlet_uk avatar image
0 Likes"
eoutlet_uk asked

API Performance is very slow

Hello, I'm writing a brand new, automated application to retrieve orders from the eBay API using the .NET SDK (Version 897). When calling GeteBayOfficeTimeCall(), it takes around 7-8 seconds for the API to return a response! Is this considered to be an acceptable time frame for a response? Do other Calls return data faster to suggest some sort of prioritization? My Code is as follows: > class Program { static void Main(string[] args) { var apiContext = new ApiContext { SoapApiServerUrl = ConfigurationManager.AppSettings["eBayAPIURL"] }; var apiCredential = new ApiCredential { eBayToken = ConfigurationManager.AppSettings["eBayAccountToken"] }; apiContext.ApiCredential = apiCredential; apiContext.Site = SiteCodeType.UK; apiContext.Version = "897"; //Make calls var threadManager = new ThreadManager(new Dictionary ()); var thread = threadManager.InitThread(() => TestAPI(apiContext), ThreadType.CoreProcessing); thread.Start(); Console.Read(); } static void TestAPI(ApiContext context) { var officialTimeCall = new GeteBayOfficialTimeCall(context); var timeNow = DateTime.Now; Console.WriteLine(officialTimeCall.GeteBayOfficialTime()); var timeAfter = DateTime.Now; Console.WriteLine("Call Completed in: " + (timeNow - timeAfter).ToString(@"ss\.fffffff") + " secs."); } } This uses a custom ThreadManager class which is simply responsible for creating and storing threads for later interactions. I should also note that this test was carried out on the Production API. Thanks.
trading api.NET
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
outlawspeedshop avatar image
0 Likes"
outlawspeedshop answered
Hi @eoutlet_uk, From my experience with the API, the very first call for this new connection will take awhile, it seems to authenticate through eBay's API server but after that everything is alot faster. My process is: 1. Setup Connection 2. Test Connection (GeteBayOfficeTimeCall) 3. Output Time if successful else output error 4. If that work, eBay is now connected else error handlers etc. This connection will last .. months, no idea when it would close / reset, my systems been running solid for 4 months or so now with no restart or reconnects. My advice is to make a central eBay class that will hold this connection, that way you can pass it around and not have to make several connections and face the same time issue. e.g.: internal static class eBayClass { public static Boolean Connected; public static ApiContext eBayConnection; } Hope this helps.
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.