cancel
Showing results for 
Search instead for 
Did you mean: 

How to read EP 6.0 LDAP Data into my SAP Portal Application

Former Member
0 Kudos

Hi all,

It's a very urgent issue for me , please help me .

I am using Microsoft visual studio 2003 with SAP .net connector 2.0 and PDK for .net using C# ,I want to read the data of EP 6.0 LDAP in to my SAP Portal application.

My actual requirement is that

User who logged into the portal has a role to see my iview ,this information I can get by

this.User.Identity.Name

this.User.IsInRole("")

but I want to read the complete profile of this user

which is stored in the portal LDAP .How can I do this?

Please help.

Regards,

Sanjay Chatterjee.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Did you try using the PDK's UserManagment Service?

https://media.sdn.sap.com/html/submitted_docs/dotnet/Programming%20with%20PDK%20for%20.NET/Working%2...

User Information can be found with the GetUser() function of the user managment class

https://media.sdn.sap.com/html/submitted_docs/dotnet/Reference/SAP.Portal.Services.UserManagement.ht...

Hope that helped,

Ofer

Former Member
0 Kudos

Hi Ofer,

Thanks for your kind reply,yes tried UserManagment Service and the code was

string userName = this.User.Identity.Name;

UserManagement um = new UserManagement();

string temp = um.GetUser(userName).FirstName.ToString();

but here i have a problem , my LDAP schema is

"firstname"

"lastname"

"fax">

"uniquename"

"loginid"

"email">

"mobile"

"telephone"

"department"

"description"

"streetaddress"

"pobox"

by the above code i can find the first name of the user

but i want to fetch all the data like email,mobile,department etc.

How can I get these values by the above code ?

Another problem I am facing here that

if i use

string temp = um.GetUser(userName).Company.ToString();

it throws an exception

"Object reference not set to an instance of an object"

why it throws an exception?

waiting for your early reply.

Regards,

Sanjay Chatterjee

Former Member
0 Kudos

Using this service, you can only find the properties that exist in UserInfo (Company, DisplayName, FirstName, Groups, LastName, Roles, Title,UniqueId, UniqueName).

Other information could be accessed from the LDAP directly, like Yehuda has suggested.

About the other issue, I imagin either "um.GetUser(userName)" or "um.GetUser(userName).Company" returned a null (either the user wasn't found or it's company isn't initialized). You can debug and check...

Regards,

Ofer

Former Member
0 Kudos

Hi Ofer,

How can i access the information directly from LDAP.

The brief or step by step information may please be sent.

Actually i want to fetch the data for an user which is

displayed in user profile page of a user in EP.

System.DirectoryServices.DirectoryEntry("LDAP://Path");

was tried but i could't able to understand what is the path and how can i find the path of EP LDAP.

Plz help me ,it's very urgent.

Regards ,

Sanjay Chatterjee

Former Member
0 Kudos

Hi Sanjay Chatterjee,

I think you have 2 options:

1.Write java web service to perform it and consume it from .NET.

2.Look at the UME configuration screen in order to query the path.

The UME configuration screen can be found at - System Administration ->Service Configuration ->UM Configuration->LDAP Server

Regards,

Yehuda

Former Member
0 Kudos

Hi Yehuda;

I wrote a java application using UMFactory class

and getUserFactory method according the tips

given by Rafael Cardenas but I don't know how can i change it to web services for portal application.

Can we do the same thing using C# to read the content

of the user profile which was inserted at the time of

user creation in portal user management.

waiting for your reply.

Regards,

Sanjay chatterjee

Former Member
0 Kudos

If you can provide the connection info to the ldap provider you can access it directly:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconIntroductionToADSIO...

Yehuda

Former Member
0 Kudos

Hi Yehuda,

Thanks for your reply.

I am not able to understand where shoul i provide connection info ?.In my application my portal server

is already added under portals node where all the connection info for the portal server is mentioned.

My requirement is all the data of LDAP should display

into a Table control,for this where should i mention

the connection info and how connection should be established.

Regards,

Sanjay chatterjee

Former Member
0 Kudos

Hi Sanjay,

LDAP (Lightweight Directory Access Protocol) is an Internet protocol that email and other programs use to look up information from a server.In .NET you have a list of objects to perform directory search on the LDAP provider.

Currently there is no way to get the LDAP connection info that defined in EP, the only way to get the connection is to define it at EP System Landscape and then to get via the "Systems Service" from .NET.

https://media.sdn.sap.com/html/submitted_docs/dotnet/Reference/SAP.Portal.Services.Systems.html

Regards,

Yehuda