Skip to Content
author's profile photo Former Member
Former Member

PDK for .NET question

Hello

I'm trying to use the UserInfo class to get the user attributes in a portal component, but I can't instantiate the object because the compiler says that the constructor for UserInfo class takes 1 parameter, but in the online help doesn't explain how to use the constructor or which is the parameter, and also there is no sample for this assembly. The code that I'm using is:

...

#using SAP.Portal.Services.UserMAnagement;

namespace myNameSpace

{

...

public void someMethod()

{

UserInfo myUserObject = new UserInfo();

}

...

}

Has anyone a sample of how to use this class?

Regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2004 at 05:48 PM

    Hi Refael,

    The Class <i>UserInfo</i> has no constructor and you are not supposed to create an instance of it. You can get the information of the user by using the <i>User Management</i> service. Take a look at the following:

    …

    using SAP.Portal.Services.UserManagement;

    …

    public void Method1()

    {

    UserManagement um = new UserManagement();

    UserInfo userInfo = um.GetUser(this.User.Identity.Name);

    Response.Write("User : " + userInfo.DisplayName);

    }

    …

    I hope that helps.

    Yossi

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Rafael,

      You are thanking a poster for his answer.

      Please next time also give him points.

      See: /people/mark.finnern/blog/2004/08/10/spread-the-love

      This time I did it for you.

      Remember: When you ask a question you also assume the responsibility to assign points.

      Please check your other questions and if the answers were good. Spread the love and give some points.

      Thanks in advance, Mark.

  • Posted on Oct 07, 2004 at 07:30 AM

    I'm not a portal expert, but as far as I remember there is something like "GetService", where you pass in the type of service (here "UserInfo") and would get out an instance. But's I'm sure there are samples in the documentation of the PDK.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.