Thanks for the suggestions. I tried a combination of both. I moved my "TRY" up so that it encompassed the creation of the OleObject. I figured it wasn't that, because it was returning a "200" status code from the site (which means it must have connected), but I checked the registry to be sure and it was registered. Also, it's important to note that this was existing code and the machine it's running on at the client hasn't changed, only the version of PB. I also added the two extra PBDOM errors, along with a general runtime error in case it wasn't one of the PBDOM errors. The general runtime error is what fired, and it pointed to the same line (pbdom_doc = pbdom_bldr.BuildFromString(ls_response)). Bad runtime function error again. So, I'm at a loss once again as to what to try. Any other suggestions would be greatly appreciated. The new code is below. Thanks!
TRY
lole_Send = CREATE OleObject
lole_SrvHTTP = CREATE OleObject
lole_Send.connectToNewObject("Msxml2.DOMDocument.6.0")
lole_SrvHTTP.connectToNewObject("MSXML2.ServerXMLHTTP.6.0")
IF ISNULL(p_szZip) OR p_szZip = "" THEN
szApiString = "https://api.cityofnewyork.us/geoclient/v1/address.xml?houseNumber=" + szStreetNumber + "&street=" + szStreet + "&borough=" + szBoroughName +"&app_id=4fxxa&app_key=18xxx"
ELSE
szApiString = "https://api.cityofnewyork.us/geoclient/v1/address.xml?houseNumber=" + szStreetNumber + "&street=" + szStreet + "&zip=" + p_szZip +"&app_id=4fxx9a&app_key=1830xxxw"
END IF
lole_SrvHTTP.Open("GET",szApiString, FALSE)
lole_SrvHTTP.SetRequestHeader( "Content-Type", "application/json")
lole_SrvHTTP.Send(lole_Send)
ls_status = string(lole_SrvHTTP.Status)
ls_response = string(lole_SrvHTTP.ResponseText)
CATCH (Runtimeerror er)
f_display_message('501|Unable to set electoral districts at this time. ' + 'Error Message: ' + er.getMessage())
RETURN '-1'
END TRY
IF ls_status <> "200" THEN
RETURN '-1'
END IF
TRY
lReturn = XMLParseString(ls_response, ValNever!, szParsingErrors)
pbdom_bldr = Create PBDOM_Builder
pbdom_doc = pbdom_bldr.BuildFromString(ls_response)
//get the root element
szRootElementName = pbdom_doc.GetRootElement().GetName()
//the following displays the row, element and text
pbdom_doc.GetRootElement().GetContent(pbdom_obj_array)
FOR l = 1 to UpperBound(pbdom_obj_array)
pbdom_object1 = pbdom_obj_array[l]
pbdom_object1.GetContent(pbdom_elem_array)
FOR lIndex = 1 to UpperBound(pbdom_elem_array)
pbdom_elem = pbdom_elem_array[lIndex]
szName = UPPER(pbdom_elem.GetName())
szText = pbdom_elem.GetText()
CHOOSE CASE UPPER(szName)
CASE 'ASSEMBLYDISTRICT'
szAssemblyDist = szText
CASE 'CITYCOUNCILDISTRICT'
szCityCouncil = szText
CASE 'CONGRESSIONALDISTRICT'
szCongressDist = szText
CASE 'STATESENATORIALDISTRICT'
szSenatorialDist = szText
END CHOOSE
NEXT
NEXT
CATCH ( PBDOM_Exception pbde )
f_display_message('501|PBDOM Exception' + pbde.getMessage() )
RETURN '-1'
CATCH ( PBXRuntimeError re )
f_display_message('501|PBNI Exception' + pbde.getMessage() )
RETURN '-1'
CATCH (RuntimeError ex)
f_display_message('501|Runtime Exception' + ex.getMessage() )
RETURN '-1'
END TRY