Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
var entitiesCount = 0;
var pageCount = 0;
var service = provider.GetRequiredService<IBfsLegalEntitiesService>();

await foreach (var response in service.GetLegalEntitiesInPagesAsync(new GetPersonArgs(), pageSize: pageSize))
{
  entitiesCount += response.Result.Length;
  pageCount++;

  foreach (var entity in response.Result)
  {
    ProcessEntity(entity);
  }
}

Example of request content

Code Block
languagexml
POST {{hostName}}/api/bfsapi.asmx HTTP/1.1
SOAPAction: "http://tempuri.org/GetPersons"
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <GetPersons xmlns="http://tempuri.org/">
         <req>
            <Credentials>
                <UserName>{{userName}}</UserName>
                <Password>{{password}}</Password>
            </Credentials>
            <identify>{{identify}}</identify>
            <Fields>
                <BrickId>true</BrickId>
                <FirstName>true</FirstName>
                <LastName>true</LastName>
                <CreatedDate>true</CreatedDate>
                <UserName>true</UserName>
                <PersonalNumber>true</PersonalNumber>
                <CustomFields>true</CustomFields>
            </Fields>
            <EnablePagination>true</EnablePagination>
            <PageIndex>0</PageIndex>
            <PageSize>1000</PageSize>
         </req>
      </GetPersons>
   </soap:Body>
</soap:Envelope>