简体   繁体   English

使用Web服务在sharepoint中检索当前用户名

[英]Retrieve the Current User name in sharepoint using webservices

I have designed a infopath form ,in that form load option I need to retrieve the current USERNAME . 我设计了一个infopath表单,在该表单加载选项中,我需要检索当前的USERNAME Who logged in the site must retrieve using WebServices only. 登录网站的人只能使用WebServices检索。 So I did that using UserProfileServices.asmx service and GetProfileByName Method. 所以我使用UserProfileServices.asmx服务和GetProfileByName方法做到了这GetProfileByName But I'm getting different USERNAMES ,Sometimes my USERNAME Sometimes form Admin etc.....Please let me know how can I do this.... 但是我得到了不同的USERNAMES ,有时我的USERNAME有时是Admin等形式的表格。....请让我知道我该怎么做。

Please specify what "sometimes" means... And where did you get different Usernames from (WebService or from the InfoPath userName() function)? 请指定“有时”的含义...您从哪里(WebService或InfoPath userName()函数)获得了不同的用户名?

If it's the function, this is default behavior if you fill out the form using the client (InfoPath Filler). 如果是函数,则是使用客户端(InfoPath Filler)填写表单时的默认行为。 If it's the WebService make sure you also append the domain to the userName() like this 如果是WebService,请确保也将域附加到userName()上,如下所示

concat("MyDomain\"; userName())

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM