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 BranchSearch request instance. BranchSearch searchRequest = new BranchSearch() { country = "gb", Value = "Lloyds Kensington", page = 1, pageSize = 10, reportString = "TEST_001", itemisationID = "001" }; int page = 0, pages = 0; do { /// 4. Execute the search request. BranchSearchResults searchResponse = service.BranchSearch(searchRequest); /// 5. Do something with the results, here we'll just write the branch information to the console! foreach (BranchData data in searchResponse.BranchData) { Console.WriteLine(data.BranchName); } /// 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); } |