Article Details
Id:16460
Product:finPOWER Connect
Type:FIX
Version:3.02.03
Opened:17/10/2019
Closed:18/10/2019
Released:22/11/2019
Job: J023144

Security Enquiry Interface; calling Centrix functions directly in a script may fail

Calling Centrix Security Enquiry Interface functions directly via a script may fail because credentials have not been set, or it may use the incorrect Cost Centre credentials (from whatever was last executed).

This occurs because using functions like finBL.SecurityEnquiry.Service_CentrixNZ.ExecuteWheelsSearch did not refresh the service credentials from the Cost Centre.

For example, the code below highlights where the request function is called directly (and fails):

Dim Request As ISSecurityEnquiryRequest_CentrixNZ_WheelsSearch
Dim Response As ISSecurityEnquiryResponse_CentrixNZ_WheelsSearch

Request = finBL.SecurityEnquiry.Service_CentrixNZ.CreateSecurityEnquiryRequest_CentrixNZ_WheelsSearch()
With Request
  .PlateNumber = ""
End With

Main = finBL.SecurityEnquiry.Service_CentrixNZ.ExecuteWheelsSearch(Request, Response)

The code below illustrates an alternate, and standard, approach to executing this request that works correctly:

Dim Request As ISSecurityEnquiryRequest
Dim Response As ISSecurityEnquiryResponse

Request = finBL.SecurityEnquiry.Service_CentrixNZ.CreateSecurityEnquiryRequest_CentrixNZ_WheelsSearch()
With DirectCast(Request,ISSecurityEnquiryRequest_CentrixNZ_WheelsSearch)
  .PlateNumber = ""
End With

Main = finBL.SecurityEnquiry.ExecuteSecurityEnquiry(Request, Response)