Initializing help system before first use

Calling a DMP Component

The most common use of the dmp module will be to send HTTP requests to another component in the same DMP solution. To do this, you first initialize a dmpresource value with the details of the target component by calling dmpinitcomp, then use the dmphttp functions to send HTTP requests in a similar way to using plain mmhttp. For example, in an Xpress Insight app, you can send a webservice request to the status endpoint of an Xpress Executor component in the same solution as follows:

declarations
  mycomp: dmpresource
end-declarations
dmpinitcomp(mycomp,'Xpress Executor')
if mycomp.status<>DMP_OK then
  writeln('Failed to find component due to error:', mycomp.lasterror)
  exit(1)
end-if

httpStatusCode := dmphttpget(mycomp,'/rest/runtime/status','result.json')
if httpStatusCode<>200 then
  writeln('Error returned by component: ',httpStatusCode)
  exit(1)
end-if

The path you pass to the the dmphttp function will be relative to the root of the component instance URL.

When executed from a DMP component, the dmp module will take care of obtaining appropriate authorization credentials and including them in the outgoing HTTP requests.

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