Welcome to MSDN Blogs Sign in | Join | Help

The Synchronizer

sync for the masses
Demo III: Offline Application – WebService

The N-Tier demo has finally arrived. This demo shows you how to take the server side code, basically the ServerSyncProvider along with all SyncAdapters that we build in the last demo, and expose it as a web service. On the client side, you generate a web service proxy and build a thin wrapper around it to be able to plug it into the sync agent.

Unlike pervious demos, this one needs some security settings to enable the service to access SQL Server. Also the default web service proxy generated by VS won’t comile due to type definition collisions. The steps below show you how to fix all these issues to run the demo smoothly. So please follow them carefully and let me know if you ran into any troubles.

How to install OfflineAppDemo application?

  • Fire SQL server and load demo.sql file
  • Execute the script untill the "test sample" marker
  • load server_procs.sql file and execute it to install server procs
  • Install SyncWebService (see steps below)
  • Load VS solution (OfflineAppDemo-WebService Project)
  • You are ready to go

How to install SyncWebService?

  • Copy SyncWebService directory to c:\interpub\wwwroot
  • From IIS management console, setup the SyncWebService virtual directory as web application and set Application Pool to ASP.NET 2.0   
  • Give network service account read\write access to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
  • Add web reference to the project and give it a name SyncWebServiceProxy
  • Edit the Reference.cs manually and add namespace Microsoft.Synchronization.Data. Also remove code for types that are already defined in Microsoft.Synchronization.Data.dll as the sample reference.cs file shows
  • Add new login to SQL Server for Network Service and give it dbowner access to the pub database

Download Now
Feedback
: Visit Sync Services Forum
 

Update: Just to let you know, I left Microsoft to start a new company, Raveable.com: Hotel recommendations website based on semantic analysis of hotel guest reviews. I am not actively blogging about Sync Technologies. Please see Sync Team Blog for more updated content.  

Posted: Tuesday, January 30, 2007 12:53 AM by Rafik
Filed under:

Comments

Sync Services FAQ said:

Q: Are there any demos/samples available A: Yes, the Synchronizer blog has a number of great getting

# January 31, 2007 7:23 AM

Rafik said:

I hear you :). We are still working on them, should be out by end of this week or early next week unless some unforeseen issue blocks us. Please keep an eye on the forum and the blog for updates. Thanks!

# January 31, 2007 1:27 PM

Sync Services FAQ said:

Q: Is there a way that I can work with the Microsoft Sync Services without having to write so much code

# February 5, 2007 8:56 PM

Nick Randolph's .NET Travels said:

Over the last couple of days I have been putting together some sample code that will significantly reduce

# February 5, 2007 10:53 PM

ccoonen said:

Howdy, is it possible to continue running this syncing process through a WebService(proxy) but sync Blobs vs' straight text?

Thanks, any guidance is muchly appreciated!

# March 20, 2007 12:43 PM

Rafik said:

Hi there,

I just replied to your post in the forum: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1372862&SiteID=1&mode=1

Thanks

# March 20, 2007 7:16 PM

HemantKamalakar said:

Hi,

can i test the Webservice against SQL Standard and SQL Express instead of SQL CE?

# June 23, 2007 6:32 AM

Rafik said:

Hi Hemant,

As I replied to you on the forums, Work is in progess for this. I will blog about it when it is ready. Stay tuned.

Thanks

# June 28, 2007 8:51 PM

apurv_g said:

Hi Rafik,

Thanks for such great sample. Can I use this sample for data synchronization in Windows Mobile application?

Thanks

Apurva

# July 10, 2007 12:41 PM

apurv_g said:

I am creating a windows mobile application where users will always be in a connected state when synchronizing the data. In that case can I use a webservvice similar to this sample to synchronize data.

Thanks

Apurva

# July 10, 2007 1:30 PM

apurv_g said:

Rafik,

You had mentioned that  we need to remove the duplicate types from the generated reference.cs file by using the reference.cs file in the demo as a guide. I could not understand how to use that for removing duplicates. I would appreciate if you can provide some detail on this.

Thanks

Apurva

# July 12, 2007 10:23 AM

adolfojp said:

I feel Apurva's pain. I am having the same problem and I am also clueless on how to remove the duplicates from the reference.cs file.

Please help.

adolfojp

# January 16, 2008 1:46 PM
Anonymous comments are disabled
Page view tracker