Find the answer to your question
How can I log the API call request and response using the .NET SDK?
Here is a C# sample code to log your call request and response using the .NET SDK:
public ApiContext GetContext()
context = new ApiContext();
//set the your credentials
context.ApiCredential.eBayToken = "token";
context.SoapApiServerUrl = "url";
//set the version
context.Version = "1131";
//set the logging
string logFile = "LogFile.txt";
context.ApiLogManager = new ApiLogManager();
context.ApiLogManager.ApiLoggerList.Add(new FileLogger(logFile, true, true, true));
context.ApiLogManager.EnableLogging = true;
Although logging adds a little bit of an overhead to your application, it becomes fairly easy to track down errors.
How well did this answer your question?
Answers others found helpful
- How to make a call to GetProductSearchResults using the .NET SDK
- Sample Code for Exception based logging with .NET SDK using C#
- Logging only specific calls with the .NET SDK for Trading API
- Order management using Trading API - GetOrders
- .NET SDK exception '"Client found response content type of 'text/html; charset=iso-8859-1', but expected 'text/xml'"