locked
Self hosted WCF service to use Sync Framework from device RRS feed

  • Question

  • Hi

    I want to set up a self-hosted WCF Service (it will run in a windows service on the server) and consume it on a mobile device (Windows CE 5.0) to synchronize my data using the Sync Framework. I made separate contracts / serviceImpl projects, and my contract looks like this:

    <ServiceContract()> _
    Public Interface IScanSyncService

        <OperationContract()> _
        Function GetData(ByVal value As Integer) As String

        <OperationContract()> _
        Function GetServerInfo(ByVal session As SyncSession) As SyncServerInfo

        <OperationContract()> _
        Function GetSchema(ByVal tableNames As Collection(Of String), ByVal session As SyncSession) As SyncSchema

        <OperationContract()> _
        Function GetChanges(ByVal groupMetadata As SyncGroupMetadata, ByVal syncSession As SyncSession) As SyncContext

        <OperationContract()> _
        Function ApplyChanges(ByVal groupMetadata As SyncGroupMetadata, ByVal dataSet As DataSet, ByVal syncSession As SyncSession) As SyncContext

        <OperationContract()> _
        Function HelloWorld() As String
    End Interface

     

    The problem is I need a reference to this contracts dll in my mobile app, while the mobile app is built in .NET compact framework (3.5). It seems possible to add the 'regular' .NET framework reference and my solution builds, but when I deploy my app, visual studio starts copying 'regular' .NET Framework dll's to the device (dependencies of the contracts assembly I think), so my memory gets full. (all copy locals are set to false except for the contracts dll itself)

    Is there a solution to this problem or is it not possible to do this with a self-hosted WCF service? I tried this using NetCFsvcUtil to make the proxy (with the service hosted in IIS), but there are several reasons why I don't want to do it that way. These are all technologies fairly new to me, so I don't really know where to look first.

    Thanks in advance, Joachim



    Thursday, June 23, 2011 2:14 PM

Answers

All replies

  • have a look at this tutorial: http://msdn.microsoft.com/en-us/library/dd938879.aspx

    that should give you everything you need to setup a mobile device synching via WCF.

    • Marked as answer by Nina H Thursday, June 23, 2011 8:17 PM
    Thursday, June 23, 2011 2:43 PM
  • Thanks. I had a look at this a couple of hours ago but ignored it as soon as I saw they were using NetCFsvcUtil. I didn't know you could also pass a dll as an argument instead of a service reference. 
    Thursday, June 23, 2011 2:50 PM