hi,
i need to replace the console.writeline calls in the following code with something to which will output to the page so that I can check the code is working. I;ve tried using trace.write but I get an error stating that it doesnt work in this context.
can anyone help? code is below.
thanks,
lukemack
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using eBay.Service.Core.Sdk;
using eBay.Service.Call;
using eBay.Service.Core.Soap;
public partial class testing : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Execute();
}
static void Execute()
{
ApiContext context = new ApiContext();
// Credentials for the call
context.ApiCredential.ApiAccount.Developer = "removed for post";
context.ApiCredential.ApiAccount.Application = "removed";
context.ApiCredential.ApiAccount.Certificate = "removed";
context.ApiCredential.eBayToken = "removed";
// Set the URL
context.SoapApiServerUrl = "https://api.sandbox.ebay.com/wsapi";
try
{
// Create the call object
GetUserCall call = new GetUserCall(context);
String requestedUser = "yoursandboxuser";
UserType user = call.GetUser(requestedUser);
// Print the results to standard out
string test = "eBay Time: " + call.AbstractResponse.Timestamp.ToString();
Console.WriteLine("User retrieved: " + user.UserID);
Console.WriteLine("Feedback score: " + user.FeedbackScore);
Console.WriteLine("Feedback star: " + user.FeedbackRatingStar);
Console.WriteLine("Seller level: " + user.SellerInfo.SellerLevel);
Console.WriteLine("User's registered site: " + user.Site);
}
catch (ApiException e)
{
Console.WriteLine("Problem getting user. Errors listed below.");
foreach (ErrorType error in e.Errors)
{
Console.WriteLine("Error: " + error.ShortMessage);
Console.WriteLine("Message: " + error.LongMessage);
}
}
catch (Exception e)
{
Console.WriteLine("Unexplained error in making the API call" + e.StackTrace);
}
}
}