title: wcf msmq listener service removes messages but doesn't process
body: <p>I have a WCF service that creates a private message in MSMQ. The messages are being created fine, and I can see the messages that my client application is creating.</p>
  
  <p>I also have a MSMQ listener service that seems to run fine. When I start the service up, it appears to successfully "process" the messages in the queue and they are removed. However, the implementation of my listener service doesn't seem to get executed.</p>
  
  <p>I'm fairly new to MSMQ, and I have no idea why the messages are being removed from the queue, and why the code in my listener method is not getting executed.</p>
  
  <p>Below are my service classes...</p>
  
  <pre><code>[ServiceContract(Namespace = ServiceConstants.NAMESPACE, Name = "IOrderService")]
  public interface IOrderQueueProcessingService
  {
  
      [OperationContract(IsOneWay = true, Action = "*")]
      void ProcessOrderQueue(MsmqMessage&lt;string&gt; message);
  
  }
  
  public abstract class OrderQueueProcessingServiceBase : ServiceBase, IOrderQueueProcessingService
  {
      #region CONSTRUCTORS
  
      protected OrderQueueProcessingServiceBase() { }
  
      protected OrderQueueProcessingServiceBase(List&lt;EventRecord&gt; existingList) : base(existingList) { }
  
      #endregion //CONSTRUCTORS
  
      #region IOrderQueueProcessingService Members
  
  
      [OperationBehavior(TransactionScopeRequired = false, TransactionAutoComplete = true)]
      public virtual void ProcessOrderQueue(MsmqMessage&lt;string&gt; message)
      {
          throw new NotImplementedException();
      }
  
      #endregion
  }
  
  public class OrderQueueProcessingService : OrderQueueProcessingServiceBase
  {
      #region Constructors
  
  
      public OrderQueueProcessingService() {}
  
      public OrderQueueProcessingService(List&lt;EventRecord&gt; existingList) : base(existingList) { }
  
  
      #endregion
  
      /// &lt;summary&gt;
      ///     Processes any Orders in the Orders Queue
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;&lt;/param&gt;
      public override void ProcessOrderQueue(MsmqMessage&lt;string&gt; message)
      {
  
          var q = new MessageQueue(@".\private$\msmqdemo/submitorderservice.svc");
          q.Send("hey");
          /*
          using (new Tracer("OrderQueueProcessingService"))
          {
              // add data context to work with.
              using (var unitOfWork = new TLFDataContext())
              {
  
                  var newOrderLines = new List&lt;OrderLineDataContract&gt;
                                  {
                                      new OrderLineDataContract
                                          {
                                              C = "test",
                                              IC = "msw",
                                              Qty = 1,
                                              T = "volume" ,
                                              ED = DateTime.UtcNow.AddDays(5)
                                          }
                                  };
  
                  var newOrder = new OrderDataContract
                  {
                      LIs = newOrderLines.AsEnumerable(),
                      PId = 9323,
                      POId = 8686,
                      S = "new"
  
                  };
                  var orderService = new OrderService();
                  var createdOrder = orderService.CreateOrder(null, null, newOrder);
                  //unitOfWork.SubmitUnitOfWork();
  
                  //return null;
              }
          }*/
  
  
      }
  
  }
  </code></pre>
  
  <p>I commented out the code that I am eventually trying to execute, and replaced it with a simple MSMQ message send, for testing. This seems like it should work fine. Any help would be greatly appreciated.</p>
  
  <p>Config settings below...</p>
  
  <pre><code>&lt;service name="ServiceImplementation.OrderQueueProcessingService"&gt;
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress="https://localhost:9000/OrderQueueProcessingService.svc" /&gt;
        &lt;/baseAddresses&gt;
      &lt;/host&gt;
      &lt;endpoint address="net.msmq://localhost/private/testingqueue/OrderQueueProcessingService.svc" binding="netMsmqBinding" bindingConfiguration="MsmqBindingNonTransactionalNoSecurity" contract="IOrderQueueProcessingService" /&gt;
    &lt;/service&gt;
  </code></pre>