Hi guys, im pretty much done with my program but im receivin an error that i cant find where it its.
Im using a WPF application in visual studio and it uses a service reference that contains addresses and zip codes. The purpose of the program is for the user to select numbers in the GUI and search for a city with the Zip code he inputs. First, im just trying to test the function by setting the parameters myself. This is the code.

`Class MainWindow

Public zipClient As ZipCodeReference.AddressLookupSoapClient


Private Sub btnSearch_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btnSearch.Click
    Dim searchResults As zipCodeSearch.ZipCodeReference.Address
    searchResults = zipClient.ReturnCityState("33919", "0")
    MessageBox.Show(searchResults.AreaCode)

End Sub
End Class

the zipClient.ReturnCityState function mas include zipcode as string and license as string/ License should be 0.

When i test it. It only gets to that line the searchResults = zipClient.ReturnCityState("33919", "0") and stops and give me this error : "NullReferenceException was unhandled.Object reference not set to an instance of an object."

I will really appreciate your help. Thanks

wanted to add that since this is a swervice reference, the functions i believe are already created. This is that it says fot the returnCityState

Function ReturnCityState(zipcode As String, LicenseKey As String) As zipCodeSearch.ZipCodeReference.Address
Member of zipCodeSearch.ZipCodeReference.AddressLookupSoap

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