//Use the GetPersons method to get all LegalEntities in the BFS instance and write
//the BrickId's and names in the console
var client = new BFSServiceReference.bfsapiSoapClient();
var credentials = new BFSServiceReference.Credentials()
{
UserName = bfsusername, //Username of administrative user in your instance of BFS
Password = bfspassword, //Password of the administrative user in your instance of BFS
};
var persons = client.GetPersons(new BFSServiceReference.GetPersonRequest()
{
Credentials = credentials,
identify = bfsidentifier, //Identifier is a unique token for your instance of BFS
Fields = new BFSServiceReference.GetPersonFields()
{
BrickId = true,
UserName = true,
FirstName = true,
LastName = true,
},
});
foreach (var c in persons.Result)
{
Console.WriteLine(c.BrickId + "," + c.FirstName + "," + c.LastName);
} |