-1

The following code generates these two troubleshooting tips in vb.net The code builds with no errors. The locals window lists everything under OrderContext as "Nothing", 0.0 or "False" when it stop on the line which attempts to set address1.

"Use the new keyword to create an object instance."
"Check to determine if the object is null before calling the method."

Imports TPETest.com.nicusa.cdc.tpe2_ks

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim PEService As New PaymentEngineService
        Dim OrderContext() As com.nicusa.cdc.tpe2_ks.WSOrderContext

        OrderContext.customer.address.address1 = "1233 Test Dr."
        OrderContext.customer.address.city = "City"
        OrderContext.customer.address.state = "KS"
        OrderContext.customer.address.zip = "66099"
        OrderContext.attributes.SetValue("John Smith", 1)
        OrderContext.attributes.SetValue("1233 Test Dr", 2)
Joel Etherton
  • 37,325
  • 10
  • 89
  • 104

1 Answers1

3

You need to put Option Strict On at the top of your module. This would help you determine that you declared OrderContext as an array, and that as an array, it does not have either customer or attributes properties.

You may have wanted to type

Dim OrderContext As New com.nicusa.cdc.tpe2_ks.WSOrderContext
prprcupofcoffee
  • 2,950
  • 16
  • 20