How to configure SFx 2.1 N-Tier RRS feed

  • Question

  • SFx 1.0; SqlServer 2008 with CT; n-Tier WCF; PC clients

    I am trying to migrate my application from SFx 1.0 to SFx 2.1.

    Looking at this example: http://msdn.microsoft.com/en-us/library/dd918908.aspx#Y3096 (and the rest of the code in the WebSharingAppDemo) I notice that the library generated for the web service is added as a standard dll reference in the client application.

    We typically do not do this in our web services, and did not have to do this in our SFx 1.0 service either.

    Is this just because it is a demo ... or is this the recommended way?


    Tuesday, May 24, 2011 3:22 PM


All replies

  • its a demo and an extended version of the original 2-tier version and certainly not the recommended way... if you want a cleaner one, grab the Windows Azure Sync Service sample and strip out the Azure specific implementation: http://blogs.msdn.com/b/sync/archive/2010/10/07/windows-azure-sync-service-demo-available-for-download.aspx


    • Marked as answer by Yunwen Bai Wednesday, June 1, 2011 3:08 PM
    Tuesday, May 24, 2011 4:00 PM
  • Thanks, I downloaded it ... its ClientUI project also has a reference to the service's assembly (WCFSyncServiceWebRole) just like WebSharingAppDemo references its service's assembly (WebSyncContract) ...

    Following either demo, our sync button code contains this block:

    if (_ceProvider != null)
      string scopeName = string.Format(Resources.Scope_Format, txtEmployeeId.Text, Resources.Device_Config_Scope_Name);
      RelationalProviderProxy destinationProxy = new SqlSyncProviderProxy(scopeName, txtRemoteHost.Text, txtRemoteUID.Text, txtRemotePw.Text, txtRemoteCatalog.Text);
      _ceProvider.MemoryDataCacheSize = uint.Parse(txtBatchSize.Text);
      _ceProvider.ScopeName = scopeName;
      SyncOperationStatistics stats = SynchronizationHelper.SynchronizeProviders(_ceProvider, destinationProxy);

    Because "RelationalProviderProxy" is a type defined in the WCF service ... we have to have a reference to the assembly in order to run it as per the demo.

    We did try to expose it through the proxy via adding data contracts etc. ... but the errors report that the KnowledgeProvider type is not serializable.


    Question: what is the proper way to initialize the destination proxy without the client having to have knowledge of the service types since they are abstracted from our access.


    Tuesday, May 24, 2011 6:10 PM
  • move those proxy classes on the client. afaik, those proxy classes simply encapsulate the calls to the wcf service.
    Friday, May 27, 2011 6:47 AM