Initializing help system before first use

Calling a DMP Webservice

You can also use of the dmp module to send HTTP requests to a SERVERLESS_REST type webservice in the same solution. To do this, you first initialize a dmpresource value with the details of the webservice you want to talk by calling dmpinitwebservice, then use the dmphttp functions to send HTTP requests in a similar way to using plain mmhttp. For example, you can send a request to a webservice called processLoanApps as follows:

declarations
  myservice: dmpresource
end-declarations
dmpinitwebservice(myservice,'processLoanApps')
if myservice.status<>DMP_OK then
  writeln('Failed to find service due to error:', myservice.lasterror)
  exit(1)
end-if

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

When calling a webservice, you will typically leave the path field as an empty string.

© 2001-2019 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.