C# SOAP/REST Sample:
static void Main(string[] args)
{
// ******************************************************************************
// For this sample, the Request/Response Classes and SOAP Client were generated
// by adding the following references to the Visual Studio project:
// Add a Service Reference to
// (https://isi-api-doc.azurewebsites.net/LSTServicesLookupSOAP/LSTServicesLookup.asmx?WSDL)
// and set the NameSpace to "FinScanWrapper".
// Add a Reference to System.Web.Services.
// ******************************************************************************
// The REST version was using:
// RestSharp 109.0.1
// ******************************************************************************
// Create Request - used by both SOAP and REST versions to generate request using code instead of JSON/XML packets
FinScanWrapper.LSTServicesLookupRequest request = new FinScanWrapper.LSTServicesLookupRequest()
{
// Initialize Credentials
organizationName = "FinScanWrapper",
userName = "FinScanAPI",
password = "FinScanAPIPWD",
// Initialize Client Information
applicationId = "FSAPI",
clientId = "CLIENT_ID",
nameLine = "CLIENT_NAME",
gender = FinScanWrapper.SLGenderEnum.Unknown,
addressLine1 = "ADDRESS_LINE_1_OR_LEAVE_BLANK",
addressLine2 = "ADDRESS_LINE_2_OR_LEAVE_BLANK",
addressLine3 = "ADDRESS_LINE_3_OR_LEAVE_BLANK",
addressLine4 = "ADDRESS_LINE_4_OR_LEAVE_BLANK",
addressLine5 = "ADDRESS_LINE_5_OR_LEAVE_BLANK",
addressLine6 = "ADDRESS_LINE_6_OR_LEAVE_BLANK",
addressLine7 = "ADDRESS_LINE_7_OR_LEAVE_BLANK",
// Please Note the User Fields are custom for each organization
// and may be different for your setup than it is in the sandbox.
userField1Label = "Country",
userField1Value = "COUNTRY",
userField2Label = "Date of Birth",
userField2Value = "DATE_OF_BIRTH",
userField3Label = "National Id",
userField3Value = "NATIONAL_ID",
userField4Label = "User Display 4",
userField4Value = "",
userField5Label = "User Display 5",
userField5Value = "",
userField6Label = "User Display 6",
userField6Value = "",
userField7Label = "",
userField7Value = "",
userField8Label = "",
userField8Value = "",
// Leave this as an empty array. This option will generate a match whenever this user field
// matches the corresponding Compliance Record user field, regardless of the Name/Address.
userFieldsSearch = new FinScanWrapper.ArrayOfInt(),
// Used for Arabic or Chinese Script versions of the Client Name
alternateNames = new FinScanWrapper.SLAlternateName[0],
// Search Settings
searchType = FinScanWrapper.SLSearchTypeEnum.Individual,
clientStatus = FinScanWrapper.SLClientStatusEnum.Active,
clientSearchCode = FinScanWrapper.SLClientSearchCodeEnum.FullName,
// Initialize Options
options = new FinScanWrapper.SLLookupOptions()
{
sendToReview = FinScanWrapper.SLYesNoEnum.Yes,
generateclientId = FinScanWrapper.SLYesNoEnum.No,
updateUserFields = FinScanWrapper.SLYesNoEnum.No,
addClient = FinScanWrapper.SLYesNoEnum.Yes,
returnComplianceRecords = FinScanWrapper.SLYesNoEnum.No,
returnCategory = FinScanWrapper.SLYesNoEnum.No,
returnSourceLists = FinScanWrapper.SLYesNoEnum.No,
skipSearch = FinScanWrapper.SLYesNoEnum.No,
returnSearchDetails = FinScanWrapper.SLYesNoEnum.No,
skipClientUpdate = FinScanWrapper.SLYesNoEnum.No,
processUBO = FinScanWrapper.SLYesNoEnum.No,
searchUBOMembers = FinScanWrapper.SLYesNoEnum.No
},
// Used if created custom Statuses within FinScan so the Wrapper knows how to handle them
customStatus = new FinScanWrapper.SLCustomStatus[0],
// Omit or pass in 0 length Array to use Default Mandatory Compliance Lists/Categories
//lists = new FinScanWrapper.SLComplianceList[0],
// To pass in additional Compliance Lists/Categories
lists = new FinScanWrapper.SLComplianceList[1]
{
new FinScanWrapper.SLComplianceList()
{
listName = "OFAC Specially Designated Nationals",
listId = "OFC",
listCategories = new FinScanWrapper.SLComplianceListCategory[1]
{
new FinScanWrapper.SLComplianceListCategory
{
categoryName = "Full Source",
isMandatory = FinScanWrapper.SLYesNoEnum.Yes,
isSelected = FinScanWrapper.SLYesNoEnum.Yes
}
}
}
}
};
// Create Response - used by both SOAP and REST versions to process response using code instead of JSON/XML packets
FinScanWrapper.LSTServicesLookupResponse response;
// ******************************************************************************
// Call the SOAP Service
// ******************************************************************************
try
{
// Create the SOAP Client
FinScanWrapper.LSTServicesLookupSoapClient soapClient = new FinScanWrapper.LSTServicesLookupSoapClient();
// Call SLLookup
response = soapClient.SLLookup(request);
// Display Response overview
Console.WriteLine("SOAP Results:");
DisplayResponse(request.options.sendToReview, response);
}
catch (Exception ex)
{
Console.WriteLine("Exception calling FinScan Wrapper (SOAP): {0}", ex.Message);
}
// ******************************************************************************
// Call the REST Service
// ******************************************************************************
try
{
// Create the REST Client
RestClient restClient = new RestClient("https://isi-api-doc.azurewebsites.net/LSTServicesLookupREST/");
RestRequest restRequest = new RestRequest("wrapper/lookup", Method.Post);
restRequest.AddHeader("Accept", "application/json");
restRequest.RequestFormat = DataFormat.Json;
// Serialize the Request (rather than generate JSON manually)
string restBody = System.Text.Json.JsonSerializer.Serialize(request);
restRequest.AddParameter("application/json", restBody, ParameterType.RequestBody);
// Call SLLookup
RestResponse restResponse = restClient.Execute(restRequest);
string content = restResponse.Content;
// De-Serialize the Response (rather than process JSON manually)
response = System.Text.Json.JsonSerializer.Deserialize
C# REST Sample:
using RestSharp;
...
var client = new RestClient("https://isi-api-doc.azurewebsites.net/LSTServicesLookupREST/");
var request = new RestRequest("wrapper/lookup", Method.POST);
request.AddHeader("Accept", "application/json");
request.RequestFormat = DataFormat.Json;
request.Parameters.Clear();
var body = "{\n" +
" \"organizationName\":\"ORG_NAME\",\n" +
" \"userName\":\"USER_NAME\",\n" +
" \"password\":\"USER_PASSWORD\",\n" +
" \"applicationId\":\"APPL_ID\",\n" +
" \"lists\":[],\n" +
" \"searchType\":\"Individual\",\n" +
" \"clientId\":\"CLIENT_ID\",\n" +
" \"clientStatus\":\"Active\",\n" +
" \"gender\":\"Unknown\",\n" +
" \"nameLine\":\"CLIENT_NAME\",\n" +
" \"alternateNames\":[],\n" +
" \"addressLine1\":\"ADDRESS_LINE_1_OR_LEAVE_BLANK\",\n" +
" \"addressLine2\":\"ADDRESS_LINE_2_OR_LEAVE_BLANK\",\n" +
" \"addressLine3\":\"ADDRESS_LINE_3_OR_LEAVE_BLANK\",\n" +
" \"addressLine4\":\"ADDRESS_LINE_4_OR_LEAVE_BLANK\",\n" +
" \"addressLine5\":\"ADDRESS_LINE_5_OR_LEAVE_BLANK\",\n" +
" \"addressLine6\":\"ADDRESS_LINE_6_OR_LEAVE_BLANK\",\n" +
" \"addressLine7\":\"ADDRESS_LINE_7_OR_LEAVE_BLANK\",\n" +
" \"specificElement\":\"\",\n" +
" \"clientSearchCode\":\"FullName\",\n" +
" \"returnComplianceRecords\":\"No\",\n" +
" \"addClient\":\"Yes\",\n" +
" \"sendToReview\":\"Yes\",\n" +
" \"userFieldsSearch\":[],\n" +
" \"updateUserFields\":\"Yes\",\n" +
" \"userField1Label\":\"Country\",\n" +
" \"userField1Value\":\"COUNTRY\",\n" +
" \"userField2Label\":\"Date of
Birth\",\n" +
" \"userField2Value\":\"DATE_OF_BIRTH\",\n" +
" \"userField3Label\":\"National
Id\",\n" +
" \"userField3Value\":\"NATIONAL_ID\",\n" +
" \"userField4Label\":\"User Display
4\",\n" +
" \"userField4Value\":\"\",\n" +
" \"userField5Label\":\"User Display
5\",\n" +
" \"userField5Value\":\"\",\n" +
" \"userField6Label\":\"User Display
6\",\n" +
" \"userField6Value\":\"\",\n" +
" \"userField7Label\":\"\",\n" +
" \"userField7Value\":\"\",\n" +
" \"userField8Label\":\"\",\n" +
" \"userField8Value\":\"\",\n" +
" \"comment\":\"\",\n" +
" \"passthrough\":\"\",\n" +
" \"customStatus\":[],\n" +
" \"returnCategory\":\"No\",\n" +
" \"returnSourceLists\":\"No\",\n" +
" \"generateclientId\":\"No\",\n" +
" \"skipSearch\":\"No\"\n" +
"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
//
execute the request
IRestResponse response = client.Execute(request);
// Get
raw content as string
var content = response.Content;
Java SOAP Sample:
// Ran
"wsimport.exe" -p Wrapper -B-XautoNameResolution
https://isi-api-doc.azurewebsites.net/LSTServicesLookupSOAP/LSTServicesLookup.asmx?WSDL
// to
generate the stub classes needed to call the FinScan Wrapper web services.
import com.innovativesystems.*;
...
// TODO Auto-generated
method stub
LSTServicesLookupRequest
request = new LSTServicesLookupRequest();
LSTServicesLookupResponse
response = null;
// Initialize Credentials
request.setOrganizationName("ORG_NAME");
request.setUserName("USER_NAME");
request.setPassword("USER_PASSWORD");
// Initialize Client Information
request.setApplicationId("APPL_ID");
request.setClientId("CLIENT_ID");
request.setNameLine("CLIENT_NAME");
request.setGender(SLGenderEnum.Unknown);
request.setAddressLine1("ADDRESS_LINE_1_OR_LEAVE_BLANK");
request.setAddressLine2("ADDRESS_LINE_2_OR_LEAVE_BLANK");
request.setAddressLine3("ADDRESS_LINE_3_OR_LEAVE_BLANK");
request.setAddressLine4("ADDRESS_LINE_4_OR_LEAVE_BLANK");
request.setAddressLine5("ADDRESS_LINE_5_OR_LEAVE_BLANK");
request.setAddressLine6("ADDRESS_LINE_6_OR_LEAVE_BLANK");
request.setAddressLine7("ADDRESS_LINE_7_OR_LEAVE_BLANK");
request.setUserField1Label("Country");
request.setUserField1Value("COUNTRY");
request.setUserField2Label("Date of Birth");
request.setUserField2Value("DATE_OF_BIRTH");
request.setUserField3Label("National Id");
request.setUserField3Value("NATIONAL_ID");
request.setUserField4Label("User Display 4");
request.setUserField4Value("");
request.setUserField5Label("User Display 5");
request.setUserField5Value("");
request.setUserField6Label("User Display 6");
request.setUserField6Value("");
request.setUserField7Label("");
request.setUserField7Value("");
request.setUserField8Label("");
request.setUserField8Value("");
// Leave this an an empty
array. This option will generate a match whenever this user field
// matches the corresponding Compliance Record user
field, regardless of the Name/Address.
request.setUserFieldsSearch(new int [0]);
// Used for Arabic or Chinese Script versions of the
Client Name
request.setAlternateNames(new SLAlternateName[0]);
// Initialize Options
request.setSearchType(SLSearchTypeEnum.Individual);
request.setClientStatus(SLClientStatusEnum.Active);
request.setSendToReview(SLYesNoEnum.Yes);
request.setGenerateclientId(SLYesNoEnum.No);
request.setUpdateUserFields(SLYesNoEnum.No);
request.setClientSearchCode(SLClientSearchCodeEnum.FullName);
request.setAddClient(SLYesNoEnum.Yes);
request.setReturnComplianceRecords(SLYesNoEnum.No);
request.setReturnCategory(SLYesNoEnum.No);
request.setReturnSourceLists(SLYesNoEnum.No);
request.setSkipSearch(SLYesNoEnum.No);
// Used if created custom Statuses within FinScan so the
Wrapper knows how to handle them
request.setCustomStatus(new SLCustomStatus[0]);
// To use Default Mandatory Compliance Lists/Categories
request.setLists(new SLComplianceList[0]);
// To pass in Compliance Lists/Categories: OFAC Specially Designated Nationals
Full Source is shown
SLComplianceList
[] myList = new SLComplianceList[1];
myList[0] = new SLComplianceList();
myList[0].setListName("OFAC Specially Designated Nationals");
myList[0].setListId("OFC");
SLComplianceListCategory
[] myCategory = new SLComplianceListCategory[1];
myCategory[0] = new SLComplianceListCategory();
myCategory[0].setCategoryName("Full Source");
myCategory[0].setIsMandatory(SLYesNoEnum.Yes);
myCategory[0].setIsSelected(SLYesNoEnum.Yes);
myList[0].setListCategories(myCategory);
request.setLists(new SLComplianceList[1]);
// Create the Service
LSTServicesLookupSoapProxy
service = new LSTServicesLookupSoapProxy();
service.setEndpoint("https://isi-api-doc.azurewebsites.net/LSTServicesLookupSOAP/LSTServicesLookup.asmx");
// Call the Service
try
{
response = service.SLLookup(request);
// Check the Response
if (response.getStatus() != SLResultTypeEnum.ERROR
&&
response.getStatus() != SLResultTypeEnum.FAIL)
{
System.out.println("Called the FinScan Wrapper, found " + response.getReturned() + "
Matches");
}
}
catch (Exception ex)
{
System.out.println("Exception calling FinScan Wrapper:\n" + ex.getMessage());
}
Java REST Sample:
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
...
try
{
Client client = Client.create();
WebResource webResource = client.resource("https://isi-api-doc.azurewebsites.net/LSTServicesLookupREST/wrapper/lookup");
String input = "{\n" +
" \"organizationName\":\"ORG_NAME\",\n" +
" \"userName\":\"USER_NAME\",\n" +
" \"password\":\"USER_PASSWORD\",\n" +
" \"applicationId\":\"APPL_ID\",\n" +
" \"lists\":[],\n" +
" \"searchType\":\"Individual\",\n" +
" \"clientId\":\"CLIENT_ID\",\n" +
" \"clientStatus\":\"Active\",\n" +
" \"gender\":\"Unknown\",\n" +
" \"nameLine\":\"CLIENT_NAME\",\n" +
" \"alternateNames\":[],\n" +
" \"addressLine1\":\"ADDRESS_LINE_1_OR_LEAVE_BLANK\",\n" +
" \"addressLine2\":\"ADDRESS_LINE_2_OR_LEAVE_BLANK\",\n" +
" \"addressLine3\":\"ADDRESS_LINE_3_OR_LEAVE_BLANK\",\n" +
" \"addressLine4\":\"ADDRESS_LINE_4_OR_LEAVE_BLANK\",\n" +
" \"addressLine5\":\"ADDRESS_LINE_5_OR_LEAVE_BLANK\",\n" +
" \"addressLine6\":\"ADDRESS_LINE_6_OR_LEAVE_BLANK\",\n" +
" \"addressLine7\":\"ADDRESS_LINE_7_OR_LEAVE_BLANK\",\n" +
" \"specificElement\":\"\",\n" +
" \"clientSearchCode\":\"FullName\",\n" +
" \"returnComplianceRecords\":\"No\",\n" +
" \"addClient\":\"Yes\",\n" +
" \"sendToReview\":\"Yes\",\n" +
" \"userFieldsSearch\":[],\n" +
" \"updateUserFields\":\"Yes\",\n" +
" \"userField1Label\":\"Country\",\n" +
" \"userField1Value\":\"COUNTRY\",\n" +
" \"userField2Label\":\"Date of
Birth\",\n" +
" \"userField2Value\":\"DATE_OF_BIRTH\",\n" +
" \"userField3Label\":\"National
Id\",\n" +
" \"userField3Value\":\"NATIONAL_ID\",\n" +
" \"userField4Label\":\"User Display
4\",\n" +
" \"userField4Value\":\"\",\n" +
" \"userField5Label\":\"User Display
5\",\n" +
" \"userField5Value\":\"\",\n" +
" \"userField6Label\":\"User Display
6\",\n" +
" \"userField6Value\":\"\",\n" +
" \"userField7Label\":\"\",\n" +
" \"userField7Value\":\"\",\n" +
" \"userField8Label\":\"\",\n" +
" \"userField8Value\":\"\",\n" +
" \"comment\":\"\",\n" +
" \"passthrough\":\"\",\n" +
" \"customStatus\":[],\n" +
" \"returnCategory\":\"No\",\n" +
" \"returnSourceLists\":\"No\",\n" +
" \"generateclientId\":\"No\",\n" +
" \"skipSearch\":\"No\"\n" +
"}";
ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);
if (response.getStatus() != 200)
{
throw new RuntimeException("Failed : HTTP
error code : " + response.getStatus());
}
System.out.println("Output from Server .... \n");
String output = response.getEntity(String.class);
System.out.println(output);
}
catch (Exception e)
{
e.printStackTrace();
}
Python SOAP Sample:
##############################################################################################
#
WebServiceDemo.py demonstrates how to call the FinScan Wrapper web services
# using Python 3.6.0.
#
#
This program uses zeep, a
SOAP client for Python:
#
https://python-zeep.readthedocs.io/en/master/index.html
#
zeep can be installed with:
# pip install zeep
#
#
To view the availible
operations in the FinScan Wrapper using zeep, you
#
can run:
# python --mzeep https://hosted3.finscan.com/isi/Wrapper/v4.3.2/LSTServicesLookup.asmx?WSDL
##############################################################################################
from zeep import Client
from zeep import xsd
#
WSDL file is retrieved when Client is instantiated.
client
= Client(wsdl="https://hosted3.finscan.com/isi/Wrapper/v4.3.2/LSTServicesLookup.asmx?WSDL")
#
creating a dictionary with required fields for SLLookup
call
lookup_params
= {
'organizationName': 'ORG_NAME',
'userName': 'USER_NAME',
'password': '_USER_PASSWORD',
'applicationId':
'APPL_ID',
'searchType':
'Individual',
'clientId':
'CLIENT_ID',
'clientStatus':
'Active',
'gender': 'Unknown',
'nameLine': 'CLIENT_NAME',
'clientSearchCode':
'FullName',
'updateUserFields':
'No',
'returnComplianceRecords': 'Yes',
'addClient':
'No',
'sendToReview':
'No',
'returnCategory':
'No',
'returnSourceLists':
'No',
'generateclientId':
'No',
'skipSearch':
'No'
}
#
using client.service to call the SLLookup
method zeep read from the WSDL.
#
zeep will automatically
format the lookup_parms dictionary into an
appropriate object.
response
= client.service.SLLookup(lookup_params)
#print out the response from the SLLookup
call.
print(response)
XML SOAP Sample:
POST https://isi-api-doc.azurewebsites.net/LSTServicesLookupSOAP/LSTServicesLookup.asmx HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://innovativesystems.com/SLLookup" Host: isi-api-doc.azurewebsites.net Expect: 100-continue Connection: Keep-Alive Content-Length: 2931 <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <SLLookup xmlns="http://innovativesystems.com/"> <req> <organizationName>FinScanWrapper</organizationName> <userName>FinScanAPI</userName> <password>FinScanAPIPWD</password> <applicationId>FSAPI</applicationId> <lists> <SLComplianceList> <listName>OFAC Specially Designated Nationals</listName> <listId>OFC</listId> <listCategories> <SLComplianceListCategory> <categoryName>Full Source</categoryName> <isSelected>Yes</isSelected> <isMandatory>Yes</isMandatory> <isFullSource>Yes</isFullSource> </SLComplianceListCategory> </listCategories> </SLComplianceList> </lists> <searchType>Individual</searchType> <clientId>ENTER_CLIENT_ID</clientId> <clientStatus>Active</clientStatus> <gender>Unknown</gender> <nameLine>Robert Mugabe</nameLine> <alternateNames /> <addressLine1 /> <addressLine2 /> <addressLine3 /> <addressLine4 /> <addressLine5 /> <addressLine6 /> <addressLine7 /> <specificElement /> <clientSearchCode>FullName</clientSearchCode> <returnComplianceRecords>No</returnComplianceRecords> <addClient>No</addClient> <sendToReview>No</sendToReview> <userFieldsSearch /> <updateUserFields>Yes</updateUserFields> <userField1Label></userField1Label> <userField1Value></userField1Value> <userField2Label></userField2Label> <userField2Value></userField2Value> <userField3Label></userField3Label> <userField3Value></userField3Value> <userField4Label></userField4Label> <userField4Value></userField4Value> <userField5Label></userField5Label> <userField5Value></userField5Value> <userField6Label></userField6Label> <userField6Value></userField6Value> <userField7Label></userField7Label> <userField7Value></userField7Value> <userField8Label></userField8Label> <userField8Value></userField8Value> <comment /> <passthrough /> <customStatus /> <returnCategory>No</returnCategory> <returnSourceLists>No</returnSourceLists> <generateclientId>No</generateclientId> <skipSearch>No</skipSearch> <excludeFNSCategoriesFlag>No</excludeFNSCategoriesFlag> <excludeDynamicFieldsFlag>No</excludeDynamicFieldsFlag> </req> </SLLookup> </soap:Body> </soap:Envelope>
JSON REST Sample:
{ "organizationName":"ORG_NAME", "userName":"USER_NAME", "password":"USER_PASSWORD", "applicationId":"APPL_ID", "lists":[], "searchType":"Individual", "clientId":"CLIENT_ID", "clientStatus":"Active", "gender":"Unknown", "nameLine":"CLIENT_NAME", "alternateNames":[], "addressLine1":"ADDRESS_LINE_1_OR_LEAVE_BLANK", "addressLine2":"ADDRESS_LINE_2_OR_LEAVE_BLANK", "addressLine3":"ADDRESS_LINE_3_OR_LEAVE_BLANK", "addressLine4":"ADDRESS_LINE_4_OR_LEAVE_BLANK", "addressLine5":"ADDRESS_LINE_5_OR_LEAVE_BLANK", "addressLine6":"ADDRESS_LINE_6_OR_LEAVE_BLANK", "addressLine7":"ADDRESS_LINE_7_OR_LEAVE_BLANK", "specificElement":"", "clientSearchCode":"FullName", "returnComplianceRecords":"No", "addClient":"Yes", "sendToReview":"Yes", "userFieldsSearch":[], "updateUserFields":"Yes", "userField1Label":"Country", "userField1Value":"COUNTRY", "userField2Label":"Date of Birth", "userField2Value":"DATE_OF_BIRTH", "userField3Label":"National Id", "userField3Value":"NATIONAL_ID", "userField4Label":"User Display 4", "userField4Value":"", "userField5Label":"User Display 5", "userField5Value":"", "userField6Label":"User Display 6", "userField6Value":"", "userField7Label":"", "userField7Value":"", "userField8Label":"", "userField8Value":"", "comment":"", "passthrough":"", "customStatus":[], "returnCategory":"No", "returnSourceLists":"No", "generateclientId":"No", "skipSearch":"No" }