Answered by:
Sync Framework with WCF and Https

Question
-
Hallo,
I am using the MS Sync Framework to sync to SQL server 2008 Express edition database over an WCF Service. I configured the WCF service to use HTTPS and message authenticaion over Username.
The Sync works, if no security is in place, if I activate security I got errors from the KnowledgeSyncProvider.
Are there special requirements for using the Sync Framework in combination with HTTPS and message authentication??
The code basis I use is nearly the same as this http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3762 except, that I am using to SQL Server intances and now HTTPS on server side.
HTTPS and authetication is working, because I can execute test methods.
If I start the synchronize an exception is thrown at
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ClientReliableChannelBinder`1.RequestClientReliableChannelBinder`1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode)
at System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode)
at System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at WebSyncContract.IRelationalSyncContract.GetChanges(UInt32 batchSize, SyncKnowledge destinationKnowledge)
at WebSyncContract.RelationalProviderProxy.GetChangeBatch(UInt32 batchSize, SyncKnowledge destinationKnowledge, Object& changeDataRetriever) in C:\Projects\Metas\Tubes\Tube.StartApp\WebSyncContract\RelationalProviderProxy.cs:line 84
at Microsoft.Synchronization.KnowledgeProviderProxy.GetChangeBatch(UInt32 dwBatchSize, ISyncKnowledge pSyncKnowledge, ISyncChangeBatch& ppChangeBatch, Object& ppUnkDataRetriever)
at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)
at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32& changesApplied, Int32& changesFailed)
at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed)
at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()
at Microsoft.Synchronization.SyncOrchestrator.Synchronize()
at Tube.StartApp.SynchronizationHelper.SynchronizeProviders(KnowledgeSyncProvider localProvider, KnowledgeSyncProvider remoteProvider) in C:\Projects\Metas\Tubes\Tube.StartApp\Tube.StartApp\SynchronizationHelper.cs:line 41
at Tube.StartApp.Controls.SynchronizeControl.Synchronize() in C:\Projects\Metas\Tubes\Tube.StartApp\Tube.StartApp\Controls\SynchronizeControl.cs:line 170
at Tube.StartApp.Controls.SynchronizeControl.Load() in C:\Projects\Metas\Tubes\Tube.StartApp\Tube.StartApp\Controls\SynchronizeControl.cs:line 88Thursday, February 18, 2010 12:17 PM
Answers
-
Please try to turn on the WCF tracing when using HTTPS and check out the log.
Thanks.
Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.- Marked as answer by Sid Singh [MSFT]Microsoft employee Wednesday, March 24, 2010 7:07 PM
Thursday, February 18, 2010 6:33 PMAnswerer -
hi rfit,
can you post your the config file as well for the wcf entries? also, what's the exact error message you're getting (the innermost exception, as i assume the error occured at the WCF level and not with Sync Framework itself)?- Marked as answer by Sid Singh [MSFT]Microsoft employee Wednesday, March 24, 2010 7:07 PM
Friday, February 19, 2010 2:02 AM
All replies
-
Please try to turn on the WCF tracing when using HTTPS and check out the log.
Thanks.
Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.- Marked as answer by Sid Singh [MSFT]Microsoft employee Wednesday, March 24, 2010 7:07 PM
Thursday, February 18, 2010 6:33 PMAnswerer -
hi rfit,
can you post your the config file as well for the wcf entries? also, what's the exact error message you're getting (the innermost exception, as i assume the error occured at the WCF level and not with Sync Framework itself)?- Marked as answer by Sid Singh [MSFT]Microsoft employee Wednesday, March 24, 2010 7:07 PM
Friday, February 19, 2010 2:02 AM -
buble this up, any updates on the cause of this issue yet ? is this resolved ?
thanks
Yunwen
This posting is provided "AS IS" with no warranties, and confers no rights.Wednesday, February 24, 2010 7:36 AM