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 7168419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:46:37+00:00 2026-05-28T14:46:37+00:00

I have been struggling with this problem for a few days now and I

  • 0

I have been struggling with this problem for a few days now and I just can’t seem to figure it out.

I have a simple WCF web service hosted on IIS and Windows Server 2008 R2. The implementation of the Web Service is as follows:

        var completionResult = new CompletionResult();
        var updateTextMessage = new UpdateText { TextTemplateId = textTemplateId, Text = text };

        var asyncResult = Global.Bus.Send(updateTextMessage).Register(x => completionResult = x.AsyncState as CompletionResult, null);
        asyncResult.AsyncWaitHandle.WaitOne(10000);

        if (completionResult.Messages != null && completionResult.Messages.Length > 0)
        {
            return ((UpdateTextResponse)completionResult.Messages[0]).ImageData;
        }

        return string.Empty;

I know that trying to use NSB in a synchronous manner is considered bad design but I’m just experimenting and I would really like to get this working. So the issue is that the message gets successfully sent to the remote endpoint and the message is processed successfully, but the reply message is just lost in the ether when the remote endpoint does a Bus.Reply. I am using the latest version of NSB and the strange thing is this works fine on my Windows 7 development machine. I have made sure active directory is off on both machines. I have also ran Wireshark on the receiving endpoint and sure enough I see the incoming message in the packet data. It seems that something is not jiving with IIS. I also switched the logging threshold to DEBUG for both endpoints and nothing unusual is going on. The sending endpoint says the usual “sending messages to…” Here is the code in my Application_Startup for the web component:

        Bus = NServiceBus.Configure.WithWeb()
            .Log4Net()
            .DefaultBuilder()
            .XmlSerializer()
            .MsmqTransport()
                .IsTransactional(false)
                .PurgeOnStartup(false)
            .UnicastBus()
                .ImpersonateSender(false)
            .CreateBus()
            .Start();

Here are the configs for the endpoints:

IIS Config (this side is not getting the response)

<MsmqTransportConfig InputQueue="Web.InputQueue" ErrorQueue="Web.ErrorQueue" MaxRetries="5" NumberOfWorkerThreads="1"/>
  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="Messages" Endpoint="Node.Distributor.DataInputQueue"/>
    </MessageEndpointMappings>
  </UnicastBusConfig>

---------------------------------------------------------------

Endpoint which does the reply

<MsmqTransportConfig ErrorQueue="Node.ErrorQueue" InputQueue="Node.InputQueue" MaxRetries="5" NumberOfWorkerThreads="1"/>
<UnicastBusConfig DistributorControlAddress="Node.Distributor.ControlInputQueue" DistributorDataAddress="Node.Distributor.DataInputQueue" />

I also created two standalone NServiceBusHost applications to test communication and it worked successfully. I also hard coded the return address and replaced the .Reply with a .Send but specifying the actual destination and it still didn’t work. So again it seems to be related to IIS. Any help would be greatly appreciated!

  • 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-05-28T14:46:38+00:00Added an answer on May 28, 2026 at 2:46 pm

    I solved the problem. Turns out the reason for the replies getting lost was due to the fact that I was referencing the distributor as such:

    <UnicastBusConfig DistributorControlAddress="Node.Distributor.ControlInputQueue@10.1.4.58" DistributorDataAddress="Node.Distributor.DataInputQueue@10.1.4.58" />
    

    But it turns out that the NServiceBus distributor doesn’t like IPs. So I changed it to the following:

    <UnicastBusConfig DistributorControlAddress="Node.Distributor.ControlInputQueue@HOSTNAME" DistributorDataAddress="Node.Distributor.DataInputQueue@HOSTNAME" />
    

    and this solved the problem. I also had to update my hosts file in Windows since NSB/MSMQ uses hostnames. I am not sure if this is a bug in NServiceBus or if it is a known issue but it should really be documented if it isn’t already.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been struggling with this for several days now and I ran out
I have a problem that I have been struggling with for a few days
I've been struggling with this query for a few days now. I'm using PHP/MySQL.
I have been struggling with this problem for the last few hours, and it
I have been struggling with this problem for a while now. I have a
I have been struggling with this for three days now and this is what
I have been struggling with this problem for a while now, so any help
I have been struggling with this issue for some days now and I really
I have been struggling with a problem in the past few days. I really
I have been struggling to find a solution to this problem. In my code,

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.