Start New Discussion within our Software Development Community

To be clear, what I am trying to acheive is:
Have my Paypal current balance show up in a textbox on VB.NET using the PayPal API
Not a VB.Net Webbrowser

I have followed the guide on this page

But I keep getting the error
Object reference not set to an instance of an object.

when I execute this code in VB.NET:

Public Class Form1

Private Sub btnGetBalance_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetBalance.Click
Dim credentials As New UserIdPasswordType
credentials.Username = "*********"
credentials.Password = "****************"
credentials.Signature = "****************.****************-****************"
credentials.Subject = "****************@********"

Dim customSecurityHeader As New CustomSecurityHeaderType
customSecurityHeader.Credentials = credentials

Dim ServiceInterface As New PayPalAPISoapBinding
ServiceInterface.Url = ""
ServiceInterface.RequesterCredentials = customSecurityHeader

Dim request As New GetBalanceRequestType
request.Version = "59.0"

Dim req As New GetBalanceReq
req.GetBalanceRequest = request

Dim response As GetBalanceResponseType
response = ServiceInterface.GetBalance(req)

Me.txtBalance.Text = response.Balance.Value
End Sub
End Class

Has anyone managed to get this to work??
If so, please lend a hand

That blog was written in 2008, perhaps they have made some updates since then.
I noticed in one of the comments below that "request.Version" has another value.

If you take a look in "PayPalSvc.wsdl" and locate the entry "ns:version" you might find the correct value to use.

This article has been dead for over six months. Start a new discussion instead.