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 here because I'm trying to implement a scenario of user profile synchro with bcs connecting to wcf service.

Here is the context:

A remote web service is returning a full list of employee infos. The goal is to sync the profile DB with AD for certain properties and this web service for some others.

My Implementation:

Since the web service wasn't designed to be consumed by BCS, I recreated a WCF service that I deployed into SP 2010 ISAPI folder. This WCF service exposes a method to retrieve an employee by a uniqueID which is present in the AD properties and will allow the link between external source and AD. This WCF service connects to the remote webservice, retrieve the entire list of employees, transform it into datatable, put it in cache and then do a select on this datable with the unique employee id and return the entity as result. In the same time I created an external content type by using Visual Studio 2010 and not SP designer. The BDCModel connects in the readItem method to my WCF service to retrieve the good employee.

Here are my questions:

  1. I deployed everything and this is working fine except that I need to add into the app.config of the MIIServer.exe application the WCF service information so that the user profile synchronization service is able to connect to my WCF. On the web I see many examples where external content types are created by SPDesigner and it doesn't seems that the configuration of the WCF service needs to be added to the MIIServer.exe app.config since SPD stores the configuration as xml in BCS Metadata Store. Is there a way for not adding WCF service configuration info in MIIServer.exe when creating external content types with visual studio?
  2. When a user profile property is configured, there is a possibility to add multiple mappings. What I want to know is the behavior of SP when there is 2 mappings? for example: BCS source then AD source. Will SharePoint will connect to the 2nd source if the first one return an empty value?

Don't know if this is very clear but any help would be appreciated.

share|improve this question
add comment

2 Answers 2

1. When you start the User Profile Synchronization service on the synchronization server, SharePoint Server (2013) provisions a version of Microsoft Forefront Identity Manager (FIM) to participate in synchronization. FIM (miiserver.exe) needs to know at runtime the location of your WCF service.

Separate from UPS (profile sync) is the creation of an ECT (external content type). This ECT can be created by VS or SPD. Even if the ECT is created by SPD, config about the WCF needs to be added to miiserver.exe.config for FIM to be able to import data from your external business system at runtime.

Src: http://blogs.technet.com/b/meamcs/archive/2013/02/18/sharepoint-2010-2013-user-profile-synchronization.aspx

2. To import profiles from one of the supported directory services, you create a synchronization connection to the directory service. To import additional profile properties from a business system, you create an external content type to bring the data from the business system into SharePoint Server, and then create a synchronization connection to the external content type.

Each user who you want to have a profile in SharePoint Server must have an identity in a directory service. (If users are not represented in a directory service, you can’t synchronize user profiles.)

To import properties from a business system, you will need an external content type that brings the property value from the external system into SharePoint Server.

To indicate that a user profile property comes from an external system, you map the property to a specific attribute of the external system. By default, certain user profile properties are mapped.

When you synchronize profile information, in addition to importing profile properties from external systems, you can also write data back to a directory service. You can’t write data back to a business system. To indicate that SharePoint Server should export a user profile property, you map the property, and set the direction of the mapping to Export.

Src: http://technet.microsoft.com/en-us/library/ff182925.aspx#connections

share|improve this answer
add comment

What I don't fully understand is why you've built a second webservice on top of the existing one. You could reuse that some code (a wrapper class as you might call it) and provide BCS with a .NET assembly instead. Adding a second webservice will only cause delay. The only scenario I could imagine is when the second webservice provides additional functionality which is used in multiple apps.

The WCF framework will need a (binding) configuration, but you can also create that in code. The only downside to that is that you need to recompile when something changes, like security settings. But with most webservices, that doesn't really happen that often. So code the configuration and provide the URL to the service (which is more likely to change) using SPPersistedObject (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.sppersistedobject.aspx) or property bag storage. Any credentials you might need can be stored in the secure store service app.

As for your question about the mappings; I don't think there's such a thing. If you provide two sources for the same property, the last import will win I guess. And since profile import is usually incremental, the last change in either one will prevail. But I must say this is just theory, haven't tested it.

share|improve this answer
add comment

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.