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.prognoz.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.prognoz.ru/PP.SOM.Som" xmlns:q1="http://www.prognoz.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>
  <vis>1</vis>
  <type>User</type>
<sid>
  <sid>PS-1-1</sid>
  <type>User</type>
  </sid>
  </subject>
<emails>
<its>
<it>
  <name>Work</name>
  <email>NewWork@example.ru</email>
  </it>
<it>
  <name>Mobile</name>
  <email>NewMobile@example.ru</email>
  </it>
<it>
  <name>Personal</name>
  <email>NewHome@example.ru</email>
  </it>
  </its>
<def>
  <name>Work</name>
  <email>NewWork@example.ru</email>
  </def>
<work>
  <name>Work</name>
  <email>NewWork@example.ru</email>
  </work>
<personal>
  <name>Personal</name>
  <email>NewHome@example.ru</email>
  </personal>
<mobile>
  <name>Mobile</name>
  <email>NewMobile@example.ru</email>
  </mobile>
  </emails>
<props>
<its>
<it>
  <k>1</k>
  <id>Location</id>
  <value>Home</value>
  <dt>1</dt>
  </it>
  </its>
  </props>
  </it>
  </its>
  </profiles>
  <bisearchEnable>Disable</bisearchEnable>
  </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",
"vis" : "1",
"type" : "User",
"sid" :
{
"sid" : "PS-1-1",
"type" : "User"
}
},
"emails" :
{
"its" :
{
"it" :
[
{
"name" : "Work",
"email" : "NewWork@example.ru"
},
{
"name" : "Mobile",
"email" : "NewMobile@example.ru"
},
{
"name" : "Personal",
"email" : "NewHome@example.ru"
}
]
},
"def" :
{
"name" : "Work",
"email" : "NewWork@example.ru"
},
"work" :
{
"name" : "Work",
"email" : "NewWork@example.ru"
},
"personal" :
{
"name" : "Personal",
"email" : "NewHome@example.ru"
},
"mobile" :
{
"name" : "Mobile",
"email" : "NewMobile@example.ru"
}
},
"props" :
{
"its" :
{
"it" :
[
{
"k" : "1",
"id" : "Location",
"value" : "Home",
"dt" : "1"
}
]
}
}
}
]
}
},
"bisearchEnable" : "Disable"
}
}
}
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