views:

23

answers:

1

Hi,

I'm trying to create a service reading the dead-letter from the transactional system dead letter queue.

The service configuration looks like this:

<service name="NotificationDeadLetterQueueService">
 <endpoint
  address="net.msmq://localhost/system$;DeadXact"
  binding="netMsmqBinding"
  contract="INotificationService"
/>
</service>

My service interface:

[ServiceContract]
public interface INotificationService
{
[OperationContract(IsOneWay=true)]
[NetDataContractSerializerFormatAttribute]
void HandleNotification(Notification notification);
}

With my service implementation:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
public class NotificationDeadLetterQueueService : INotificationService
{
   #region INotificationService Members

   [OperationBehavior(TransactionScopeRequired = true)]
   public void HandleNotification(Notification notification)
   {
      throw new NotImplementedException();
   }

   #endregion
}

And start the host like this:

ServiceHost serviceHost = new ServiceHost(typeof(NotificationDeadLetterQueueService));
serviceHost.Open();

So far everything looks like described in many books and tutorials, but when I generate dead-letters within the transactional dead-letter queue the service does not get invoked. What is wrong in my service?

Thanks for help Enyra

A: 

I found the problem, which is quite trick. The msmq client endpoint uses a binding configuration with , so the dead-letter queue service also needs a binding which defines the security mode to none.

Enyra