Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8475253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:50:38+00:00 2026-06-10T17:50:38+00:00

I have a WCF Windows Service that checks for MSMQ messages. It picks the

  • 0

I have a WCF Windows Service that checks for MSMQ messages.
It picks the messages up ok but the ProcessMSMQMessage event does not seem to get called.

Any ideas why this is? Have I set ProcessMSMQMessage event correctly? Or am I missing something?

My code is below. Thanks.

WCF Service Class…

public partial class MyService : ServiceBase
{

  private ServiceHost host;

  public MyService()
  {
    InitializeComponent();
  }

  protected override void OnStart(string[] args)
  {
    string queueName = ConfigurationManager.AppSettings["ProcessMsgQueueName"];
    if (!MessageQueue.Exists(queueName))
    {
      MessageQueue thisQueue = MessageQueue.Create(queueName, true);
      thisQueue.SetPermissions("Everyone", MessageQueueAccessRights.ReceiveMessage);
    }

    try
    {
      Uri serviceUri = new Uri("msmq.formatname:DIRECT=OS:" + queueName);

      // communicate to MSMQ how to transfer and deliver the messages
      MsmqIntegrationBinding serviceBinding = new MsmqIntegrationBinding();
      serviceBinding.Security.Transport.MsmqAuthenticationMode = MsmqAuthenticationMode.None;
      serviceBinding.Security.Transport.MsmqProtectionLevel = System.Net.Security.ProtectionLevel.None;

      serviceBinding.SerializationFormat = MsmqMessageSerializationFormat.Binary;

      host = new ServiceHost(typeof(MyService.Service1)); // add watcher class name
      host.AddServiceEndpoint(typeof(MyService.IService1), serviceBinding, serviceUri);
      host.Open();
    }
    catch (Exception ex)
    {
      EventLog.WriteEntry("SERVICE" + ex.Message, EventLogEntryType.Error);
    }
  }

  protected override void OnStop()
  {
    if (host != null)
     host.Close();
  }
}

IService1 Contract…

[ServiceContract(Namespace = "MyService")]
[ServiceKnownType(typeof(Events.Dashboard_Message))]
public interface IService1
{
  [OperationContract(IsOneWay = true)]
  void ProcessMSMQMessage(MsmqMessage<Events.Dashboard_Message> msg);
}

Service1 Class…

public class Service1 : IService1
{
  [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
  public void ProcessMSMQMessage(MsmqMessage<Events.Dashboard_Message> msg)
  {
    string msgName = msg.GetType().Name;

    // send to eventlog
    EventLog.WriteEntry("MyService", msgName);  
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:50:40+00:00Added an answer on June 10, 2026 at 5:50 pm

    Got it working finally.

    The issue was in IService1 contract. Needed to add Action = "*".

    [OperationContract(IsOneWay = true, Action = "*")]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a wcf service library that is hosted in a windows service. I
We have created a WCF service hosted in a windows service that handles Authentication
I have six wcf services that I'm hosting in a windows service. Everything works
I have a WCF service that is hosted inside a Windows Service. The Windows
I have a WCF service that is running as a windows service. As soon
I have a WCF service hosted in a Windows service that I set to
I have created a WCF service that is hosted using windows service. The windows
I have a WCF service that is hosted in a Windows Service. Clients that
I have a windows service that uses WCF to connect to other services. It
i have a web application that connects to a windows service via WCF and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.