I'm trying to call a web service hosted in http://gis.hcpid.org/fmoweb/Service.asmx, but I'm getting "Server was unable to process request. ---> Object reference not set to an instance of an object." at run time.
I added the web service in my Visual Studio 2012 using this procedure: right click on project name, Add service reference, Advanced, Add web reference, in URL field I put "http://gis.hcpid.org/fmoweb/Service.asmx", in web reference field I put "GIS" and I click on "Add reference button"
This is my code (C# code):
GIS.Service ResultSvc = new GIS.Service();
string ResultStr = ResultSvc.Find_Address("1234 fake st", "77384");
What I'm doing wrong? Any ideas?
EDIT:------------------------------- Unfortunately, I don't have access to the web service source code. I'm just trying to port a very older webpage (8+ years) to a new asp.net webapp. The older webpage calls the service in this way (VB code)
Dim gis As GIS2.Service = New GIS2.Service
Dim xyString As String = Nothing
Dim txtZipInt As Integer = Nothing
Dim txtAddress As String = Nothing
txtZip = "77384"
txtZipInt = CInt(killChars2(txtZip))
txtAddress = "1234 fake"
xyString = gis.Find_Address(txtAddress.ToString, txtZipInt)
In this case, the second parameter is an integer! But the web service expects two string parameters!