locked
EndPointNotFoundException: There was no channel that could accept the message with action RRS feed

  • Question

  • I recently added a lot of new tables and two new scopes to my Sync and I've been running into this error when I Sync. It could happen in the second scope or the last scope but it only has a fit about it when I close the final scope.

    I am using a Dynamic Provider going from Sql Server to Sql Compact. I can't remember what article I used but somebody on this site found a simple way to do it. I am also using a Proxy for the Dynamic Provider. The sync has been working quite well until I added these new tables and two new scopes. I originally had them all running at the same time for an initial sync (first run) and I changed it so they run one after another which didn't help me at all. I am also batching the results because all together this is over 1m rows of data.

    I am not sure exactly what is needed but here are two pieces of the puzzle.

    This is from my trace error log:

    Exception Tree:  System.ServiceModel.EndpointNotFoundException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

    Message: There was no channel that could accept the message with action 'http://schemas.xmlsoap.org/ws/2005/02/rm/AckRequested'.

    Stack Trace: System.ServiceModel.Dispatcher.ErrorBehavior.ThrowAndCatch(Exception e, Message message)
    System.ServiceModel.Channels.DatagramChannelDemuxer`2.ProcessItem(TInnerItem item)
    System.ServiceModel.Channels.DatagramChannelDemuxer`2.HandleReceiveResult(IAsyncResult result)
    System.ServiceModel.Channels.DatagramChannelDemuxer`2.OnReceiveCompleteStatic(IAsyncResult result)
    System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
    System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
    System.ServiceModel.Channels.ReplyChannel.HelpReceiveRequestAsyncResult.OnReceiveRequest(IAsyncResult result)
    System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
    System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
    System.ServiceModel.Channels.InputQueue`1.AsyncQueueReader.Set(Item item)
    System.ServiceModel.Channels.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)
    System.ServiceModel.Channels.InputQueue`1.EnqueueAndDispatch(T item, ItemDequeuedCallback dequeuedCallback, Boolean canDispatchOnThisThread)
    System.ServiceModel.Channels.InputQueueChannel`1.EnqueueAndDispatch(TDisposable item, ItemDequeuedCallback dequeuedCallback, Boolean canDispatchOnThisThread)
    System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, ItemDequeuedCallback dequeuedCallback, Boolean canDispatchOnThisThread)
    System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, ItemDequeuedCallback callback)
    System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)
    System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2()
    System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke()
    System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks()
    System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(Object state)
    System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
    System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
    System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

    My current WebConfig File:

    <?xml version="1.0"?>
    <configuration>
     <configSections>
      <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
       <section name="My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
      </sectionGroup>
     </configSections>
     <system.web>
      <compilation debug="true"/>
      <membership defaultProvider="ClientAuthenticationMembershipProvider">
       <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
       </providers>
      </membership>
      <roleManager defaultProvider="ClientRoleProvider" enabled="true">
       <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
       </providers>
      </roleManager>
     </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 behaviorConfiguration="SyncServiceBehavior" name="UtilityService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="largeMessageHttpBinding" contract="IUtility">
         <!--<identity>
          <dns value="localhost"/>
         </identity>-->
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
         <baseAddresses>
          <add baseAddress="http://localhost:8000/GDFieldSystemSync/UtilityService/"/>
         </baseAddresses>
        </host>
       </service>
       <service behaviorConfiguration="SyncServiceBehavior" name="SqlWebSyncService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="largeMessageHttpBinding" contract="ISqlSyncContract">
         <identity>
          <dns value="localhost"/>
         </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
         <baseAddresses>
          <add baseAddress="http://localhost:8000/GDFieldSystemSync/SqlSyncService/"/>
         </baseAddresses>
        </host>
       </service>
       <service behaviorConfiguration="SyncServiceBehavior" name="DynamicSyncService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="largeMessageHttpBinding" contract="IDynamicSyncContract">
         <identity>
          <dns value="localhost"/>
         </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
         <baseAddresses>
          <add baseAddress="http://localhost:8000/GDFieldSystemSync/DynamicSyncService/"/>
         </baseAddresses>
        </host>
       </service>
      </services>
      <bindings>
       <wsHttpBinding>
        <!-- We are using Server cert only.-->
        <binding name="largeMessageHttpBinding" transactionFlow="True" receiveTimeout="00:05:00" sendTimeout="00:05:00" maxReceivedMessageSize="999999999">
         <readerQuotas maxArrayLength="999999999" maxStringContentLength="9999999"/>
         <reliableSession enabled="true"/>
         <security mode="Message">
          <message clientCredentialType="Certificate"/>
         </security>
        </binding>
       </wsHttpBinding>
      </bindings>
      <behaviors>
       <serviceBehaviors>
        <behavior name="SyncServiceBehavior">
         <serviceMetadata httpGetEnabled="true"/>
         <serviceDebug includeExceptionDetailInFaults="true"/>
         <serviceCredentials>
          <serviceCertificate findValue="CN=tempCert"/>
          <clientCertificate>
           <authentication certificateValidationMode="PeerOrChainTrust" revocationMode="NoCheck"/>
          </clientCertificate>
         </serviceCredentials>
        </behavior>
       </serviceBehaviors>
      </behaviors>
     </system.serviceModel>
     <system.diagnostics>
      <sources>
       <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
        <listeners>
         <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="d:\Traces.svclog"/>
        </listeners>
       </source>
      </sources>
     </system.diagnostics>
     <!--<system.diagnostics>
      <switches>
       -->
     <!-- 0-off, 1-error, 2-warn, 3-info, 4-verbose. -->
     <!--
       <add name="SyncTracer" value="0" />
      </switches>
      <trace autoflush="true">
       <listeners>
        <add name="TestListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="d:\TraceSampleServer.txt" />
       </listeners>
      </trace>
     </system.diagnostics>-->
     <startup>
      
     <supportedRuntime version="v2.0.50727"/></startup>
     <applicationSettings>
      <My.MySettings>
       <setting name="RuneMode" serializeAs="String">
        <value>internal</value>
       </setting>
      </My.MySettings>
     </applicationSettings>
     <appSettings>
      <add key="ClientSettingsProvider.ServiceUri" value=""/>
     </appSettings>
    </configuration>
    
    
    Thursday, February 10, 2011 5:08 PM

All replies

  • Can you explain a little bit more on the scenario you had working, what you changed (table/scopes added) and then what you are syncing. I am not sure I understood the whole sequence of things that happened. Did you add new tables and new scopes and then existing scopes started failing? or new scopes were added that contain tables (that were part of some other scope) and then the new/old scopes started failing etc.

    This will help narrow down the cause of the problem.


    This posting is provided AS IS with no warranties, and confers no rights
    Wednesday, February 16, 2011 8:52 AM
  • I added a new scope and changed existing ones. When I changed them though I deleted the 3 scope tables and my local db. I then reran it with my piece that defines which tables are in a scope and then creates it.

    I am basically doing an initial sync because I threw away all of my changes on the client side and recreated the scope on the server side.

    Here are my Functions that create the scope on the Server Side. They are a bit wordy and no I am not using the Profile scope yet.

     Public Function ConfigureSqlSyncProvider(ByVal hostName As String, ByVal ScopeName As String) As SqlSyncProvider
    
      Dim provider As New SqlSyncProvider
      provider = New SqlSyncProvider
      provider.ScopeName = ScopeName
    
      Dim builder As New SqlConnectionStringBuilder()
      builder.DataSource = hostName
      builder.IntegratedSecurity = True
      builder.InitialCatalog = "SOMEDB"
      builder.ConnectTimeout = 99999999
      provider.Connection = New SqlConnection(builder.ToString())
    
      'create anew scope description and add the appropriate tables to this scope
      Dim scopeDesc As New DbSyncScopeDescription(ScopeName)
    
      'class to be used to provision the scope defined above
      Dim serverConfig As New SqlSyncScopeProvisioning(DirectCast(provider.Connection, System.Data.SqlClient.SqlConnection))
    
      'determine if this scope already exists on the server and if not go ahead and provision
      'Note that provisioning of the server is oftentimes a design time scenario and not something
      'that would be exposed into a client side app as it requires DDL permissions on the server.
      'However, it is demonstrated here for purposes of completentess.
      If Not serverConfig.ScopeExists(ScopeName) Then
       Try
        'add the approrpiate tables to this scope  
        scopeDesc = AddTablesToScope(ScopeName, scopeDesc, provider.Connection)
    
        'note that it is important to call this after the tables have been added to the scope
        serverConfig.PopulateFromScopeDescription(scopeDesc)
    
        'indicate that the base table already exists and does not need to be created
        serverConfig.SetCreateTableDefault(DbSyncCreationOption.Skip)
        serverConfig.SetPopulateTrackingTableDefault(DbSyncCreationOption.Skip)
    
        'provision the server
        serverConfig.Apply()
       Catch ex As Exception
        Throw ex
       End Try
      End If
    
      'Register the BatchSpooled and BatchApplied events. These are fired when a provider is either enumerating or applying changes in batches.
      'provider.BatchApplied += New EventHandler(Of DbBatchAppliedEventArgs)(AddressOf provider_BatchApplied)
      'provider.BatchSpooled += New EventHandler(Of DbBatchSpooledEventArgs)(AddressOf provider_BatchSpooled)
    
      Return provider
     End Function 
    Private Function AddTablesToScope(ByVal scopeName As String, ByVal scopeDesc As DbSyncScopeDescription, ByVal cn As SqlConnection) As DbSyncScopeDescription
      Select Case scopeName.ToLower
       Case "lookup"
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("SalesRep", cn))
    
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Country", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("State", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("County", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("PostalCode", cn))
    
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("BookBinding", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Manufacturer", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Subject", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Currency", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("InsertType", cn))
    
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Division", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("OfficeStatus", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("OrderType", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Status", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Campaign", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("CustomerMARC", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("CustomerException", cn))
    
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("ServiceClass", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("LsService", cn))
    
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("SQLScript", cn))
       Case "order"
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Config", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldCustomer", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldCustomerException", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldShipTo", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldContact", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Journal", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Task", cn))
        'scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("SalesRepTerritory", cn))
    
        'scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Barcode", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldOrder", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldOrderService", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldOrderSubstitute", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldOrderArTestDetail", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("FieldOrderDetail", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("OrderOfficeStatus", cn))
       Case "catalog"
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Item", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Series", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("ItemCountryExclusion", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("ItemSubject", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("PriceList", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("SalesPriceMethod", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("PriceListContent", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("PriceListSeries", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("PurchasePrice", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("SalesPrice", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("SeriesContent", cn))
    
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("CInsert", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("CInsertDescription", cn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("CInsertSeries", cn))
    
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("ItemMARC", cn))
       Case "profile"
    
       Case "history"
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("CustomerHistory", cn))
       Case "DatabaseVersionNo".ToLower
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("DatabaseVersionNo", cn))
      End Select
    
      Return scopeDesc
     End Function
    
    Wednesday, February 16, 2011 2:31 PM
  • I believe you are trying a n-tier sync. If so, can you try a two tier sync and make sure your scenario first works and then we can troubleshoot where the issue is.
    This posting is provided AS IS with no warranties, and confers no rights
    Friday, February 18, 2011 5:46 AM
  • What is the batch size you are using? Can you try with a smaller batch size?

    Also try with a higher value for the httpRuntime MaxRequestLenght - <httpRuntime maxRequestLength="25000" />

    Finally enable WCF tracing and see if that helps us narrow down the issue.


    This posting is provided AS IS with no warranties, and confers no rights
    Wednesday, February 23, 2011 6:10 AM
  • OK so the problem wasn't the size or length of time. In my custom proxy that I made I Implemented IDisposable and was calling dispose at the end of each scope. For some reason it didn't have a problem with it for the first 3 scopes but the last one it had a fit about.

    I removed it for now but that brings another question. How well does the Sync Process clean up after itself? Should I not even of cared about disposing?

    Friday, March 4, 2011 9:10 PM