LISTING 1: MAPPOINT WEB SERVICE CALL

//find service
p_findservicesoap        lws_findservice

//Soap connection
SoapConnection        sc

//an address
p_address addressA, addressB

//our result set
p_findresults findresults

p_findaddressspecification specificationA
p_findresults findresultspointa
p_findaddressspecification specificationB
p_findresults findresultspointb
p_latlong waypoints[2]


        //create our connection
        sc = CREATE SoapConnection
	   sc.SetBasicAuthentication("", "111311", "Pda7608!")
        sc.CreateInstance ( lws_findservice, "p_findservicesoap")
        SetPointer(HourGlass!)

        
        addressA.addressline = '3518 W. Melrose'
        addressA.primarycity = 'Chicago'
        addressA.postalcode = '60640'
        addressA.countryregion ='MapPoint.NA'
        mle_start.text = addressA.addressline + "~r~n" + addressA.primaryCity + " " +
		 addressA.postalCode

        specificationA.inputaddress = addressA
        specificationA.datasourcename = 'MapPoint.NA'
        specificationA.options.thresholdscore = 0

        specificationA.options.range.startindex = 0
        specificationA.options.range.count = 25


	Try
        findresultspointa = lws_findservice.findaddress(specificationA)
	Catch( SoapException e)
        	MessageBox('', e.text)
        	RETURN
	End Try

        addressB.addressline = '3570 Las Vegas Boulevard'
        addressB.primarycity = 'Las Vegas'
        addressB.postalcode = '89109'
        addressB.countryregion =''
        mle_end.text = addressB.addressline + "~r~n" + addressB.primaryCity + " " +
		 addressB.postalCode

        specificationB.inputaddress = addressB
        specificationB.datasourcename = 'MapPoint.NA'

        SetNull(specificationB.options.range.count)
        SetNull(specificationB.options.range.startindex)

        findresultspointb = lws_findservice.findaddress(specificationB)

        If findresultspointa.numberfound = 0 or findresultspointb.numberfound = 0 Then
                MessageBox('', 'Problem Will Robinson')
                Return
        End If

        waypoints[1] = findresultspointa.Results[1].FoundLocation.LatLong
        waypoints[2] = findresultspointb.Results[1].FoundLocation.LatLong

        mle_coordinates.text = "Address 1:~r~n     Latitude: " + String(waypoints[1].latitude)
		 + "~r~n     Longitude: " + String(waypoints[1].longitude) + "~r~n~r~n" + &
		 "Address 2:~r~n     Latitude: " + String(waypoints[2].latitude) + "~r~n     Longitude:
		  " + String(waypoints[2].longitude)