question

eoutlet_uk avatar image
0 Likes"
eoutlet_uk asked

Cannot paginate with WSDL .NET. Is there a better API?

Hi,

I added a service for the Ebay WSDL service and I'm trying to perform the GetSellerTransactions call. It returns fine however whenever I increment the page number, it keeps returning the first page.

Here is my code;

public async Task<List<TransactionType>> GetOrders()
        {
            var transactions = new List<TransactionType>();

            var morePages = true;
            var pageNumber = 1;

            while (morePages)
            {
                var channel = _ebayApiService.ChannelFactory.CreateChannel(new System.ServiceModel.EndpointAddress($"{_ebaySettings.Value.ApiServerUrl}?callname=GetSellerTransactions"));
                var getSellerTransactionsResponse = await channel.GetSellerTransactionsAsync(new GetSellerTransactionsRequest
                {
                    GetSellerTransactionsRequest1 = new GetSellerTransactionsRequestType
                    {
                        Pagination = new PaginationType 
                        { 
                            EntriesPerPage = 100, 
                            PageNumber = pageNumber
                        },
                        IncludeContainingOrder = true,
                        ModTimeFrom = DateTime.UtcNow.AddHours(-_ebaySettings.Value.OrdersCreatedBeforeHours),
                        ModTimeTo = DateTime.UtcNow,
                        Version = "1131"
                    },
                    RequesterCredentials = new CustomSecurityHeaderType
                    {
                        Credentials = new UserIdPasswordType
                        {
                            AppId = "",
                            DevId = "",
                            AuthCert = "",
                        },
                        eBayAuthToken = "",
                    },
                });
    return transactions;
}


I have also noticed that it doesn't seem to be respecting the ModTimeTo and ModTimeFrom properties either, resulting in 60+ pages to paginate over which is obviously not right for my time frame.

.NET Core has been around for years. We're on .NET 6 which is LTS. The Ebay SDK only support up to .NET Framework 4 which is obviously an old version of .NET that I'd rather not target.

If there is a better API that I'm not aware of, can you please advise? Otherwise please can someone assist on getting this WSDL service to work please?

Thanks.

getsellertransactionswsdlgetsellertransactionscallcharp
10 |600

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

0 Answers

·

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.