Initializing help system before first use

Error handling

You should always check the status attribute of the dmpresource after every dmpinit call, to see if it succeeded or not. This status will be DMP_OK on success, DMP_NOT_FOUND if the resource you requested did not exist, DMP_ACCESS_DENIED if you don't have access to the resource you requested; any other values indicate internal errors. When the status is not DMP_OK, you can find a human-readable error message in the lasterror attribute. For example:

declarations
  myservice: dmpresource
end-declarations
dmpinitwebservice(myservice,'processLoanApps')
if myservice.status=DMP_OK then
  writeln('Service found OK')
elif myservice.status=DMP_NOT_FOUND then
  writeln('Service not found')
else then
  writeln('Failed to find service due to error:', myservice.lasterror)
end-if

httpStatusCode := dmphttppost(myservice,'','request.json','result.json')
if httpStatusCode<>200 then
  writeln('Error returned by webservice: ',httpStatusCode)
  exit(1)
end-if

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.