title: WCF MsmqIntegrationBinding - Some XML messages not being picked up
body: <p>I am using a WCF service to pick up messages off of MSMQ.  I have found that some of the messages are not being picked up and I am not sure why.  How can I try to debug this? I don't see any errors being thrown, the service is just not picking up messages off o the queue.  I am using MsmqMessage to enqueue / dequeue the messages.  </p>
  
  <p>Message size: 146,000 bytes (not that big).  </p>
  
  <p>What I have found: if I cut down the message size (delete some of the content).  So it could be size related or it could be content.  Nothing crazy in the xml though.</p>
  
  <p>Any ideas?</p>
  
  <p>Service Configuration:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;appSettings&gt;
      &lt;!-- use appSetting to configure MSMQ queue name --&gt;
      &lt;add key="QueueName" value=".\private$\MyMessageQueue" /&gt;
      &lt;add key="baseAddress" value="http://localhost:8000/test/message" /&gt;
    &lt;/appSettings&gt;
    &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service behaviorConfiguration="MessageServiceBehavior" name="WcfServiceClient.MessageServiceClient"&gt;
          &lt;!-- .Net endpoint--&gt;
          &lt;endpoint address="msmq.formatname:DIRECT=OS:.\private$\MyMessageQueue"
                    binding="msmqIntegrationBinding"
                    bindingConfiguration="DotNetBinding"
                    contract="WcfServiceClient.IMessageProcessor" /&gt;
          &lt;endpoint
                    address="mex"
                    binding="mexHttpBinding"
                    contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="MessageServiceBehavior"&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
            &lt;serviceMetadata /&gt;
            &lt;!--&lt;serviceThrottling maxConcurrentCalls="20" maxConcurrentSessions="20" /&gt;--&gt;
            &lt;serviceTimeouts /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;msmqIntegrationBinding&gt;
          &lt;binding serializationFormat="ActiveX" name="ActiveXBinding" durable="true" exactlyOnce="true"&gt;
            &lt;security mode="None" /&gt;
          &lt;/binding&gt;
          &lt;binding serializationFormat="Xml" name="DotNetBinding" durable="true" exactlyOnce="true"&gt;
            &lt;security mode="None" /&gt;
          &lt;/binding&gt;
        &lt;/msmqIntegrationBinding&gt;
      &lt;/bindings&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>EDIT:</strong>
  When I turn on tracing (Just figured this out) I get this? Doesn't make any sense to me?</p>
  
  <pre><code>&lt;E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"&gt;
  &lt;System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"&gt;
  &lt;EventID&gt;131075&lt;/EventID&gt;
  &lt;Type&gt;3&lt;/Type&gt;
  &lt;SubType Name="Error"&gt;0&lt;/SubType&gt;
  &lt;Level&gt;2&lt;/Level&gt;
  &lt;TimeCreated SystemTime="2011-12-28T20:32:42.8874263Z" /&gt;
  &lt;Source Name="System.ServiceModel" /&gt;
  &lt;Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /&gt;
  &lt;Execution ProcessName="WcfServiceClient.vshost" ProcessID="6316" ThreadID="12" /&gt;
  &lt;Channel /&gt;
  &lt;Computer&gt;MyComputer&lt;/Computer&gt;
  &lt;/System&gt;
  &lt;ApplicationData&gt;
  &lt;TraceData&gt;
  &lt;DataItem&gt;
  &lt;TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"&gt;
  &lt;TraceIdentifier&gt;http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx&lt;/TraceIdentifier&gt;
  &lt;Description&gt;Throwing an exception.&lt;/Description&gt;
  &lt;AppDomain&gt;WcfServiceClient.vshost.exe&lt;/AppDomain&gt;
  &lt;Source&gt;System.ServiceModel.Channels.TransportReplyChannelAcceptor+TransportReplyChannel/58366981&lt;/Source&gt;
  &lt;Exception&gt;
  &lt;ExceptionType&gt;System.ServiceModel.CommunicationObjectAbortedException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/ExceptionType&gt;
  &lt;Message&gt;The communication object, System.ServiceModel.Channels.TransportReplyChannelAcceptor+TransportReplyChannel, cannot be used for communication because it has been Aborted.&lt;/Message&gt;
  &lt;StackTrace&gt;
  at System.ServiceModel.Channels.CommunicationObject.ThrowIfAborted()
  at System.ServiceModel.Channels.InputQueueChannel`1.EndDequeue(IAsyncResult result, TDisposable&amp;amp; item)
  at System.ServiceModel.Channels.ReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext&amp;amp; context)
  at System.ServiceModel.Dispatcher.ReplyChannelBinder.EndTryReceive(IAsyncResult result, RequestContext&amp;amp; requestContext)
  at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext&amp;amp; requestContext)
  at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
  at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)
  at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
  at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
  at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)
  at System.Runtime.InputQueue`1.Shutdown(Func`1 pendingExceptionGenerator)
  at System.ServiceModel.Channels.InputQueueChannel`1.OnClosing()
  at System.ServiceModel.Channels.CommunicationObject.Abort()
  at System.ServiceModel.Dispatcher.ListenerHandler.AbortChannels()
  at System.ServiceModel.Dispatcher.ListenerHandler.OnAbort()
  at System.ServiceModel.Channels.CommunicationObject.Abort()
  at System.ServiceModel.Dispatcher.ChannelDispatcher.OnAbort()
  at System.ServiceModel.Channels.CommunicationObject.Abort()
  at System.ServiceModel.ServiceHostBase.OnServiceHostFaulted(Object sender, EventArgs args)
  at System.ServiceModel.Channels.CommunicationObject.OnFaulted()
  at System.ServiceModel.Channels.CommunicationObject.Fault()
  at System.ServiceModel.ServiceHostBase.OnChannelDispatcherFaulted(Object sender, EventArgs e)
  at System.ServiceModel.Channels.CommunicationObject.OnFaulted()
  at System.ServiceModel.Channels.CommunicationObject.Fault()
  at System.ServiceModel.Dispatcher.ChannelDispatcher.OnListenerFaulted(Object sender, EventArgs e)
  at System.ServiceModel.Channels.CommunicationObject.OnFaulted()
  at System.ServiceModel.Channels.CommunicationObject.Fault()
  at System.ServiceModel.Channels.Msmq4PoisonHandler.InternalFinalDisposition(MsmqQueue disposeFromQueue, MsmqMessageProperty messageProperty)
  at System.ServiceModel.Channels.Msmq4PoisonHandler.FinalDisposition(MsmqMessageProperty messageProperty)
  at System.ServiceModel.Channels.MsmqDecodeHelper.DecodeIntegrationDatagram(MsmqIntegrationChannelListener listener, MsmqReceiveHelper receiver, MsmqIntegrationInputMessage msmqMessage, MsmqMessageProperty messageProperty)
  at System.ServiceModel.MsmqIntegration.MsmqIntegrationInputChannel.DecodeMsmqMessage(MsmqInputMessage msmqMessage, MsmqMessageProperty property)
  at System.ServiceModel.Channels.MsmqInputChannelBase.TryReceive(TimeSpan timeout, Message&amp;amp; message)
  at System.ServiceModel.Dispatcher.InputChannelBinder.TryReceive(TimeSpan timeout, RequestContext&amp;amp; requestContext)
  at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.TryReceive(TimeSpan timeout, RequestContext&amp;amp; requestContext)
  at System.ServiceModel.Dispatcher.ChannelHandler.TryTransactionalReceive(Transaction tx, RequestContext&amp;amp; request)
  at System.ServiceModel.Dispatcher.ChannelHandler.TransactedLoop()
  at System.ServiceModel.Dispatcher.ChannelHandler.SyncTransactionalMessagePump()
  at System.ServiceModel.Dispatcher.ChannelHandler.OnStartSyncMessagePump(Object state)
  at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
  at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
  at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
  &lt;/StackTrace&gt;
  &lt;ExceptionString&gt;System.ServiceModel.CommunicationObjectAbortedException: The communication object, System.ServiceModel.Channels.TransportReplyChannelAcceptor+TransportReplyChannel, cannot be used for communication because it has been Aborted.&lt;/ExceptionString&gt;
  &lt;/Exception&gt;
  &lt;/TraceRecord&gt;
  &lt;/DataItem&gt;
  &lt;/TraceData&gt;
  &lt;/ApplicationData&gt;
  &lt;/E2ETraceEvent&gt;
  </code></pre>