0

我正在尝试使用 ebay 的 getFeedback API 为指定用户获取一些数据,并最终得到此代码。

namespace one
{
class Program
{
    private static ApiContext apiContext = null;

    static void Main(string[] args)
    {
        ApiContext apiContext = GetApiContext();

        GeteBayOfficialTimeCall apiCall = new GeteBayOfficialTimeCall(apiContext);

        GetFeedbackCall call = new GetFeedbackCall(apiContext);
        call.UserID = "abc";

        Console.WriteLine(call.GetFeedback().ToString());
        Console.ReadKey();
    }

    static ApiContext GetApiContext()
    {

        if (apiContext != null)
        {
            return apiContext;
        }
        else
        {
            apiContext = new ApiContext();


            apiContext.SoapApiServerUrl = ConfigurationManager.AppSettings["Environment.ApiServerUrl"];
            ApiCredential apiCredential = new ApiCredential();
            apiCredential.eBayToken = ConfigurationManager.AppSettings["UserAccount.ApiToken"];
            apiContext.ApiCredential = apiCredential;

            apiContext.Site = SiteCodeType.US;

            return apiContext;
        }
    }
}
}

它在控制台中打印以下行

eBay.Service.Core.Soap.FeedbackDetailTypeCollection

如何获取原始数据?

4

1 回答 1

1

call.GetFeedback() 返回 FeedbackDetailType 成员的集合,因此您可以使用 foreach 检索有关所有特定反馈的信息(例如反馈分数和其他内容)。

在此处查看 FeedbackDetailType 成员的完整成员列表 !

例如

foreach (FeedbackDetailType feedback in call.GetFeedback())
{
       Console.WriteLine(feedback.CommentText);
       //and other stuff
}

或者你可以使用类似的东西

    call.GetFeedback();
    Console.WriteLine(call.FeedbackScore);
于 2012-12-09T19:41:37.277 回答