Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to use the SharePoint 2010 SOAP web services to get/update User information, which seems to work OK when the user comes from Active Directory, but not when trying to find a user in Forms Based Authentication (same for Groups vs. Roles).

The SOAP XML I use is this:

POST http://mySPserver/_vti_bin/usergroup.asmx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/directory/GetUserInfo"
Cookie: FedAuth=77u...; expires=Fri, 22-Jul-2011 02:05:20 GMT; path=/; HttpOnly
User-Agent: Jakarta Commons-HttpClient/3.1
Host: xxxx.xxxx.com
Content-Length: 368

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/">
   <soapenv:Header/>
   <soapenv:Body>
       <dir:GetUserInfo>
           <dir:userLoginName>DOMAIN\user</dir:userLoginName>
       </dir:GetUserInfo>
   </soapenv:Body>
</soapenv:Envelope>

This works just fine, when specifing DOMAIN\user but if I change that line to

<dir:userLoginName>user@emaildomain.xxx</dir:userLoginName>

I get a 500 Internal Server Error and <errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">User cannot be found.</errorstring>

Is there a trick to getting SOAP Web Services to work with FBA?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I really have no idea if you can get it to work, but you can do the following to check it out:

on a dev-environment (where FBA does work), open up your database. Find the database where your application makes use of. Open that database and find yourself the table "UserInfo". In that table, there is a column "tp_Login". Check what values are in that table and use one of those values to query the webservice.

CAUTION: NEVER EVER alter the databases of sharepoint!

share|improve this answer
    
Using 'i:0#.f|fbamembershipprovider|user@domain.xxx' (which is the value of tp_login' worked for getting the user info from dbo.UserInfo. Thanks. Now I have to work out if it's possible to actuially update the aspnet_* FBA tables, rather than the SharePoint database tables. –  QMKevin Jul 22 '11 at 18:13

One way to find out what ShPt wants to hear as "loginName" or "userLoginName" is to make a GetCurrentUserInfo request. It needs no parameters hence is unlikely to fail, but only works for the current user.

Another way is to look it up in the "Account" column of the UserInformationList, https://myserver/site/_catalogs/users/ on your site.

Anyway, a name in the form i:0#.f|idproviderservice|username (as mentioned above) should come out.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.