locked
GetSchema On Proxy Instance RRS feed

  • Question

  • Hi,

    I'm new to SyncFramework and WCF. With the HowTos I tried to build a N-Tier scenario (SqlCE clients to Sql Server). Now I get exactly the same error as mentioned in this post:
    http://social.microsoft.com/Forums/en/syncgeneral/thread/81722996-7937-472f-85f7-dd82e9cc8c92

    {"GetSchema method not found on proxy instance."}

    I have already changed the endpoint in app.config to basicHttpBinding, but still get this exception.

    I'm using

    Win7 x64
    VS2010
    SQL Server 2008
    SqlCe 3.5 SP2

    Hope somebody can help me. This is the code:

    Service contract:

        [ServiceContract]
     public interface IServiceForSync
     {
      [OperationContract()]
      SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession);
    
      [OperationContract()]
      SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession);
    
      [OperationContract()]
      SyncSchema GetSchema(Collection<string> tableNames, SyncSession syncSession);
    
      [OperationContract()]
      SyncServerInfo GetServerInfo(SyncSession syncSession);
    
     }
    

    Implementation:


        public class ServiceForSync : IServiceForSync
     {
      private SampleServerSyncProvider _serverSyncProvider;
    
      public ServiceForSync()
      {
       this._serverSyncProvider = new SampleServerSyncProvider();
      }
    
      public SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
      {
       return this._serverSyncProvider.ApplyChanges(groupMetadata, dataSet, syncSession);
      }
    
      public SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
      {
       return this._serverSyncProvider.GetChanges(groupMetadata, syncSession);
      }
    
      public SyncSchema GetSchema(Collection<string> tableNames, SyncSession syncSession)
      {
       return this._serverSyncProvider.GetSchema(tableNames, syncSession);
      }
    
      public SyncServerInfo GetServerInfo(SyncSession syncSession)
      {
       return this._serverSyncProvider.GetServerInfo(syncSession);
      } 
     }
    

      And App.config:

    <?xml version="1.0"?>
    <configuration>
     <system.web>
     <compilation debug="true"/>
     <httpRuntime maxRequestLength="65536"/>
     </system.web>
     <!-- When deploying the service library project, the content of the config file must be added to the host's 
     app.config file. System.Configuration does not support config files for libraries. -->
     <system.serviceModel>
     
     <services>
      <service name="SyncService.ServiceForSync" behaviorConfiguration="SyncService.SyncServiceBehavior">
      <endpoint name="basicHttpBinding"
       address="" 
       binding="basicHttpBinding" 
       contract="SyncService.IServiceForSync">
      </endpoint>
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" name="mexHttpBinding"/>
      <host>
       <baseAddresses>
       <add baseAddress="http://localhost:8000/SqlSyncService/"/>
       </baseAddresses>
      </host>
      </service>
     </services>
    
     <behaviors>
      <serviceBehaviors>
      <behavior name="SyncService.SyncServiceBehavior">
       <!-- To avoid disclosing metadata information, 
       set the value below to false and remove the metadata endpoint above before deployment -->
       <serviceMetadata httpGetEnabled="True"/>
       <!-- To receive exception details in faults for debugging purposes, 
       set the value below to true. Set to false before deployment 
       to avoid disclosing exception information -->
       <serviceDebug includeExceptionDetailInFaults="True"/>
      </behavior>
      </serviceBehaviors>
     </behaviors>
     
     </system.serviceModel>
     <startup/>
    </configuration>
    
    

     

    Many thanks!


    Thursday, May 19, 2011 11:33 PM

Answers

  • can you confirm what methods are in your proxy? how did you add the reference?(via Add Web Reference or via svcutil?). have you tried updating the web reference?
    • Marked as answer by Yunwen Bai Tuesday, May 24, 2011 7:39 AM
    Friday, May 20, 2011 3:10 AM

All replies

  • can you confirm what methods are in your proxy? how did you add the reference?(via Add Web Reference or via svcutil?). have you tried updating the web reference?
    • Marked as answer by Yunwen Bai Tuesday, May 24, 2011 7:39 AM
    Friday, May 20, 2011 3:10 AM
  • Hi JuneT and thanks for your answer.

    First I added the proxy via Add Web Reference. Now, I create the proxy with ChannelFactory and it works.
    I don't know why it did not work with Add Web Reference, so I can't post a solution...

     

    Thanks again.

    Friday, May 20, 2011 9:47 AM