locked
Get the current user without writing code RRS feed

Answers

  • This web service is only available in MOSS.  There is no User Profile Service in WSS 3.0, because that is the free, base version that does not have enterprise capabilities.

    Qdabra has created the Active Directory Web Service specifically to help in this scenario.  It does all the same things without needing MOSS plus a few extra things.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force

    • Marked as answer by Seven M Friday, September 24, 2010 7:17 AM
    Friday, September 17, 2010 7:40 PM
  • You can if you add it all to a custom list (contact list) and create a data connection to retrieve from this list.  You'd have to maintain that list manually with all users' profile data.
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    • Marked as answer by Seven M Friday, September 24, 2010 7:16 AM
    Friday, September 17, 2010 8:26 PM

All replies

  • Nobody can help me with this?
    Friday, September 17, 2010 12:18 PM
  • This web service is only available in MOSS.  There is no User Profile Service in WSS 3.0, because that is the free, base version that does not have enterprise capabilities.

    Qdabra has created the Active Directory Web Service specifically to help in this scenario.  It does all the same things without needing MOSS plus a few extra things.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force

    • Marked as answer by Seven M Friday, September 24, 2010 7:17 AM
    Friday, September 17, 2010 7:40 PM
  • ok thnx, i'm a trainee so i cant decide on buying Qdabra.

    so there is no other way to get user's data out of wss 3 sites in infopath?

    Friday, September 17, 2010 8:11 PM
  • You can if you add it all to a custom list (contact list) and create a data connection to retrieve from this list.  You'd have to maintain that list manually with all users' profile data.
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    • Marked as answer by Seven M Friday, September 24, 2010 7:16 AM
    Friday, September 17, 2010 8:26 PM
  • may be you can try to query the userinfo sharepoint list?

    with SharePoint designer, go to the root site of your site collection, you will find a built-in folder _catalogs, where you can find a list named users (user Information List).

    hopefully it helps,

     

    Monday, September 20, 2010 1:44 PM
  • Hi,

    @Guangming

    You cannot get the current Logged in user through User Information List. I know you want a no code solution but as you have said that its not working in your case (as you are using WSS), then try using this one line script to get the current user's name : 

    SPContext.Current.Web.CurrentUser.Name;

    I am not sure whether this will work in WSS or not but give it a try.

    Regards

    Ginni

    Monday, September 20, 2010 3:50 PM
  • you are right: the list returns all users not the current one.

    InfoPath tells account of the current user, you can use that account info to find more information such as email , display name, .... from that list.

    Monday, September 20, 2010 5:23 PM
  • Ginni,  How do I use this script.  WSS3.0 only here.  What do I do?  Create a data connection to ???
    Greg Appelt
    Wednesday, September 22, 2010 2:30 PM
  • Hi,

    Well I am not sure that whether this script will run in WSS 3.0 or not. Basically I use this script in the Infopath form or in any of the functions in the workflow, depending on when do i need the name of the current user.

    For eg : If you want to get the name of the current user once the form is submitted then write this script in the submit function of the Infopath Form.

    Regards

    Ginni [My SharePoint Blog]

    Wednesday, September 22, 2010 5:26 PM
  • i got a solution for what i was looking for. i created a form using the user information list.

    it still works fine.

    but thnx for your help. i appreciate it

    Friday, September 24, 2010 12:35 PM
  • I as well have a question regarding the "Get the current user without writing code" tutorial.

    So I am running MOSS '07 and InfoPath 2007; and when I create a new data connection to recieve, using the SOAP web service, I get this error: Web Service URL - http://<server>/_vti_bin/UserProfileService.asmx?WSDL

    The file is not a valid XML file.
    The file is not a valid XML document.
    A document must contain exactly one root element.
      Line 1, Position 0

    I've verified the web service URL does pull up all the methods in a web browser

    I verified the userprofileservice.asmx, was in \\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI - Only reason is the company upgraded from WSS to MOSS a few weeks before I started. Opening the method :

    <%@ WebService Language="c#" Class="Microsoft.Office.Server.UserProfiles.UserProfileService, Microsoft.Sharepoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

    My new boss really wants me to get this function working in, so I'm pretty desperate for some help.. Anyone run into this before?

    Thursday, September 30, 2010 9:13 PM