Getting Information about User Profiles

Below is the example of using the GetMbSec operation to get information about the current user profile. The request contains the repository connection moniker. The response contains information about email addresses and additional properties of user saved in the profile.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetMbSec xmlns="http://www.fsight.ru/PP.SOM.Som">
<tMbSec xmlns="">
  <id>S1!M</id>
  </tMbSec>
<tArg xmlns="">
<pattern>
  <profiles>Get</profiles>
<profilesFilter>
  <current>true</current>
  </profilesFilter>
<profile>
  <subject>true</subject>
  <data>true</data>
  </profile>
  </pattern>
  </tArg>
  </GetMbSec>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetMbSecResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M</id>
  </id>
<meta xmlns="">
<profiles>
<its>
<it>
  <k>0</k>
  <id>PS-1-1</id>
  <n>ADMIN</n>
  <vis>1</vis>
<sid>
  <sid>PS-1-1</sid>
  </sid>
<subject>
  <k>2147483649</k>
  <id>ADMIN</id>
  <n>User</n>
  <vis>1</vis>
  <type>User</type>
<sid>
  <sid>PS-1-1</sid>
  <type>User</type>
  </sid>
  </subject>
<emails>
<its>
<it>
  <name>Work</name>
  <email />
  </it>
<it>
  <name>Mobile</name>
  <email />
  </it>
<it>
  <name>Personal</name>
  <email />
  </it>
<it>
  <name>324</name>
  <email>123@mail.ru</email>
  </it>
  </its>
  </emails>
<props>
  <its />
  </props>
  </it>
  </its>
  </profiles>
  <bisearchEnable>Full</bisearchEnable>
<apply>
<onCredentialsRequired>
<logonParams>
  <descr>Enter user name and password of the user who has permissions to create tables in the 'Database' database</descr>
  <realm>OBJ21909</realm>
  <toAdmin>1</toAdmin>
<logonData>
  <driver>MSSQL2012</driver>
  <server>v-nrspo-mssql.dev.fs.fsight.world</server>
  <database>p7repository</database>
  </logonData>
  </logonParams>
  </onCredentialsRequired>
  </apply>
  </meta>
  </GetMbSecResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetMbSec" :
{
"tMbSec" :
{
"id" : "S1!M"
},
"tArg" :
{
"pattern" :
{
"profiles" : "Get",
"profilesFilter" :
{
"current" : "true"
},
"profile" :
{
"subject" : "true",
"data" : "true"
}
}
}
}
}

JSON response:

{
"GetMbSecResult" :
{
"id" :
{
"id" : "S1!M"
},
"meta" :
{
"profiles" :
{
"its" :
{
"it" :
[
{
"k" : "0",
"id" : "PS-1-1",
"n" : "ADMIN",
"vis" : "1",
"sid" :
{
"sid" : "PS-1-1"
},
"subject" :
{
"k" : "2147483649",
"id" : "ADMIN",
"n" : "User",
"vis" : "1",
"type" : "User",
"sid" :
{
"sid" : "PS-1-1",
"type" : "User"
}
},
"emails" :
{
"its" :
{
"it" :
[
{
"name" : "Work",
"email" : ""
},
{
"name" : "Mobile",
"email" : ""
},
{
"name" : "Personal",
"email" : ""
},
{
"name" : "324",
"email" : "123@mail.ru"
}
]
}
},
"props" :
{
"its" : ""
}
}
]
}
},
"bisearchEnable" : "Full",
"apply" :
{
"onCredentialsRequired" :
{
"logonParams" :
{
"descr" : "Enter user name and password of the user who has permissions to create tables in the 'Database' database",
"realm" : "OBJ21909",
"toAdmin" : "1",
"logonData" :
{
"driver" : "MSSQL2012",
"server" : "v-nrspo-mssql.dev.fs.fsight.world",
"database" : "p7repository"
}
}
}
}
}
}
}
public static GetMbSecResult GetUserProfiles(string mb)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var getMbSec = new GetMbSec()
{
tArg = new GetMbSecArg()
{
pattern = new MbSecMdPattern()
{
//Parameters for getting user profile information
profiles = ListOperation.Get,
profile = new MbSecProfilePattern()
{
subject = true
},
profilesFilter = new MbSecProfilesFilter()
{
current = true
}
}
},
tMbSec = new MbId() { id = mb }
};
//Get information on user profiles
var result = somClient.GetMbSec(getMbSec);
return result;
}

See also:

GetMbSec: Operation