hatem elshenawy

hi

i have this scenario , i have change the authentication to form, and save the user profile data in database, then i have create BDC that read from DB and map the fields to sharepoint user profile, but then i need in the run time when user acoount created i need to import the user data to sharepoint profile by code, how i can do that




Re: SharePoint - Business Data Catalog Import user profile from BDC in runtime using Object Model

Nick Swan

Hi Hatem,

let me just clarify the scenario.

You have set your SharePoint 2007 site to run off Forms Authentication, and you want to import your aspnetdb database into the BDC so that you can search for users details

This is no problem. Just create your application defintion file and make sure you implement a specific finder method and IdEnumerator for you User Entity. Then set this as a Content Source for search. If you set it to be crawled every hour (depends how often you get new users registering I guess), new users will show up in search results when they have been crawled.

Sorry if I've completely mis understood your question! :-)

Nick






Re: SharePoint - Business Data Catalog Import user profile from BDC in runtime using Object Model

hatem elshenawy

hi Nick

what i need is importing the user profile from db to sharepoint , i have make the BDC that read from db and i have mapped the fields to sharepoint user profile, but i want the import process be run by my code not by the schedule ,becuase i have make webpart -integrated with sharepoint - that add account and user profile to db then i want to run the import process to move the user profile from db to sharepoint userprofile.

thanks for you fast response and help.






Re: SharePoint - Business Data Catalog Import user profile from BDC in runtime using Object Model

Nick Swan

So this is a case of running the User Import Process by code

I'm not sure to be honest that running that process everytime a new user registers would be such a good idea I guess it depends how many users you are expecting to register






Re: SharePoint - Business Data Catalog Import user profile from BDC in runtime using Object Model

hatem elshenawy

I try to solve this problem by accessing the profile object model and it works when run it as console application, but when I try as web part from portal to create user profile I get the following error"

System.UnauthorizedAccessException: Access Denied: To create a user profile, you must be an administrator, or create your own profile and have personal features rights.

"

I have to say that the portal use form authentication not windows authentication.

I have previous thread about this issue http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1400569&SiteID=1






Re: SharePoint - Business Data Catalog Import user profile from BDC in runtime using Object Model

Frank Chiang

Hatem,

You can try to import user profile using MOSS's webservice. Type http://<yoursharepointsite>/_vti_bin/userprofileservice.asmx to see all the methods.

Pass the proper administrator credential and you may be able to do what you want.





Re: SharePoint - Business Data Catalog Import user profile from BDC in runtime using Object Model

hatem elshenawy

dear frank

could you please till me how i can send the credential to the sharepoint web service






Re: SharePoint - Business Data Catalog Import user profile from BDC in runtime using Object Model

Frank Chiang

This is a page that talks about setting credentials for web service. Hope it helps.

http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.webclientprotocol.credentials.aspx