eBay交易API GetMyeBaySelling错误“无效的应用程序名称”页面大于一个

时间:2019-11-24 14:41:14

标签: vb.net ebay-api ebay-sdk ebay-net-sdk

使用eBay Trading .NET API时,我遇到了一个奇怪的问题。

最近,在使用GetMyeBaySelling API时,我可以很好地加载第一页,但是随后的页面返回错误“无效的应用程序名称”

很显然,我为两个帖子都使用了相同的凭据,因为这是循环运行的代码。

下面的代码显示我实际上只是在循环将一条帖子循环到GetMyeBaySelling,唯一的区别是每次都是PageNumber值。

ServiceInterface是一个自定义类,基本上包含所有凭据和要发布到等的终结点。

    Dim ServiceInterface As New eBayService(e_settings, "GetMyeBaySelling")
    Dim svc As eBayAPIInterfaceService = ServiceInterface.Service
    Dim isLastPage As Boolean = False
    Dim PageNumber As Integer = 1

        Do While Not isLastPage

            ' Set up the Request (Post to eBay)
            Dim request As New GetMyeBaySellingRequestType With {
            .Version = ServiceInterface.Version,
            .WarningLevel = WarningLevelCodeType.Low,
            .ActiveList = New ItemListCustomizationType() With {
                .Include = True,
                .Pagination = New PaginationType With {
                    .EntriesPerPage = 200,
                    .PageNumber = PageNumber,
                    .EntriesPerPageSpecified = True,
                    .PageNumberSpecified = True
                }
            },
            .SoldList = New ItemListCustomizationType() With {
                .Include = True
            },
            .WarningLevelSpecified = True,
            .DetailLevel = {DetailLevelCodeType.ReturnSummary}
        }
            Dim Res As GetMyeBaySellingResponseType = svc.GetMyeBaySelling(request)

 '  SNIP - do stuff with Res
 '  ALL of this works first time, but on the second loop after PageNumber has been increased to 2, we don't get this far. An error is returned "Invalid Application Name" from the svc.GetMyeBaySelling(request) line.

            ' Determine Page Number and if this is the last page
            isLastPage = res.ActiveList Is Nothing OrElse res.ActiveList.ItemArray Is Nothing OrElse Not res.ActiveList.ItemArray.Any 
            PageNumber += 1 
    Loop

0 个答案:

没有答案