Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7399067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:00:36+00:00 2026-05-29T04:00:36+00:00

Well, the eBay SDK has a pretty nice selection of examples, but they are

  • 0

Well, the eBay SDK has a pretty nice selection of examples, but they are outdated, most will not work and you get a NullReferenceException on the line. I was a Windows coder for about 5 years (5 years ago at that, and only know enough .Net to get me by. I develop mostly large scale web-based applications)

This particular application polls the eBay API via a Windows Service at given intervals and updates an SQL database with pending orders to be shipped. This is not necessary as this code is straight forward and not the problem.

Here is the line of older VB .Net code in question, keep in mind intelliSense shows the code as valid in code view.

 Dim Transactions As TransactionTypeCollection 
 Transactions = apiCall.GetSellerTransactions("1/1/2012 5:51:09 AM", "1/30/2012 5:51:09 AM")

When this second line of code is ran I receive this error:

NullReferenceException was unhandled
Object reference not set to an instance of an object.

Visual Studio provides some troubleshooting tips such as making sure the object being set is not NULL (Nothing) before calling, and using the New keyword to create a new instance of the object before calling the method. I tried all combinations of these methods for instance:

Dim Transactions As New Transaction TypeCollection

or after Transaction was defined,

Transactions = New apicall.getSellerTransaction()
    'didnt think this would work but I've tried everything

These did not help, and also the first did not generate any additional errors (the second, as I assumed lets you know that getSellerTransaction() is not a constructor).

Any Suggestions?

Thanks for reading the long post, just wanted to be as thorough as possible. BTW I am using the latest eBay .NET SDK from developer.ebay.com trying to do a getSellerTransaction. I had simliar problems when generating tokens with but that fix was different. I think it is a syntax error. Thanks for any help. I will be here to answer any questions if you need more detail.

-Mike

Additional Code

I am using a simple streamwriter to capture just enough data from the transactions so that I know they work (when i get past this bug, the pending orders will be populated into an sql datasouce). This is also a Windows Service (hence theServiceWorkerThread) Also, the .Net demo applications provided in the eBay SDK (atleast for GetSellerTransactions fails with the same error code, same place)

 Private Sub ServiceWorkerThread(ByVal state As Object)
    ' Periodically check if the service is stopping.
    Do While Not Me.stopping
        ' Perform main service function here...
        Dim apiCall As GetSellerTransactionsCall = New GetSellerTransactionsCall(apiContext)

        Dim transactions As New TransactionTypeCollection

        'the line below causes the exception
        transactions = apiCall.GetSellerTransactions("1/1/2012 5:51:09 AM", "1/30/2012 5:51:09 AM")
        Dim trans As New TransactionType
        For Each trans In transactions

            Me.sysLog.WriteEntry("ItemId: " & trans.Item.ItemID)
            Me.sysLog.WriteEntry("TransId: " & trans.TransactionID)
            Me.sysLog.WriteEntry("TransPrice: " & trans.TransactionPrice.Value.ToString())
            Me.sysLog.WriteEntry("AmtPaid: " & trans.AmountPaid.Value.ToString())
            Me.sysLog.WriteEntry("qtyPurchased: " & trans.QuantityPurchased.ToString())
            Me.sysLog.WriteEntry("buyUserId; " & trans.Buyer.UserID)

        Next trans

        Thread.Sleep(60000)  ' Simulate some lengthy operations.
    Loop

    ' Signal the stopped event.
    Me.stoppedEvent.Set()
End Sub

<summary>
    Populate eBay SDK ApiContext instance with data from application configuration file
</summary>
<returns>ApiContext instance</returns>
<remarks></remarks>

 Private Function GetApiContext() As ApiContext

    'apiContext is a singleton
    'to  avoid duplicate configuration reading
    If (apiContext IsNot Nothing) Then
        Return apiContext
    Else
        apiContext = New ApiContext

        'set Api Server Url
        apiContext.SoapApiServerUrl = AppSettings("SopApiServerUrl")

        'declare new ApiCredential
        Dim apiCredential As ApiCredential = New ApiCredential
        'set Applcation settings (not needed with a User Token)
        apiCredential.ApiAccount.Application = AppSettings("AppId")
        apiCredential.ApiAccount.Certificate = AppSettings("AppCert")
        apiCredential.ApiAccount.Developer = AppSettings("DevId")

        'set our User Token
        apiCredential.eBayToken = AppSettings("UserToken")

        apiContext.ApiCredential = apiCredential

        'set eBay Site target to US
        apiContext.Site = SiteCodeType.US

        Return apiContext

    End If

End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:00:36+00:00Added an answer on May 29, 2026 at 4:00 am

    The problem is not Transactions being Nothing but apiCall being Nothing.

    Make sure that apiCall is initialized to a proper value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well behaved windows programs need to allow users to save their work when they
Well, my website can not redirect to https://www.facebook.com/QuaFootSpa from http://quafootspa.com/ I have tried redirection
Well, the title pretty much states it. I want to be able to draw
Well, I have a application which somehow requires some system resources, but how do
Well my windows service has to send out automated emails when the sql database
Well, I am storing variables inside of a class that will be used for
Well it's not realy causing any errors. Anyways i'm sending ajax request and getting
Well I created a jquery mobile form but the every element is in a
Well, i'm learning to work with QML and i have one doubt. In my
Well, I know there is a lots of posts about it, but I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.