Global lookup example code

using System;

using System.Collections.Generic;

 

using Absolute.Service.Server;

using Absolute.Authentication.Wasp;

...

/// 1. Create a new service proxy. Change the URL supplied.

using (BankWizardService_v1_1 service = new BankWizardService_v1_1()) {

service.Url = "bankwizardhosted url";

service.Timeout = 5000;

/// 2. To access the SoapContext see the files provided in Service\src. The first argument in the WASPToken constructor comes from a successful WASP authentication request.

service.RequestSoapContext.Security.Tokens.Add(new WaspToken(token));

service.RequestSoapContext.Security.MustUnderstand = false;

/// 3. Create and populate a Global Search request instance.

GlobalSearch searchRequest = new GlobalSearch() {

Category = CategoryType.bic;

Value = "BRNUKBI6",

page = 1,

pageSize = 10,

reportString = "TEST_001",

itemisationID = "001"

};

int page = 0, pages = 0;

do {

/// 4. Execute the search request.

GlobalSearchResults searchResponse = service.GlobalSearch(searchRequest);

/// 5. Do something with the results, write field name and field to the console!

foreach (var resultsItem in searchResponse.GlobalSearch.ResultsList) {

Console.WriteLine(resultsItem.fieldName : resultsItem.Field);

}

/// 6. Received a new search token so, update the request expression and page count accordingly.

if (searchResponse.NewToken) {

searchRequest.Value = searchResponse.Token;

pages = (int)Math.Ceiling(searchResponse.Size / (double)searchRequest.pageSize);

}

++page;

} while (page < pages);

}

This step: Performing global lookups