0

Must be doing something awfully wrong here. Here is what I'm trying to do.

I have a Message handler that should get a message from the queue. Make a WCF call, do stuff and when done, send a new message out on the bus. It is hosted in the NServiceBus.Host.Exe.

But, whenever I create the Service Client, eveything comes to a grinding halt. If I comment out the service call everything works great... Except, I need that call.

Is there a trick I must do to make WCF calls from my Message Handler when hosting it in the NServiceBus.Host.Exe? I have not made any special config in the EndPointConfig class.

 public class EndpointConfig : 
                IConfigureThisEndpoint, AsA_Server { }


 public class RequestAccountUpdateMessageHandler : IHandleMessages<RequestAccountUpdateMessage>
{
    public void Handle(RequestAccountUpdateMessage message)
    {
        // The Line below hangs everything
        AccountService.AccountServiceClient client = 
           new AccountService.AccountServiceClient();

        resp = client.DoStuff(message.parameter);


         Bus.Send<UpdateAccountMessage>(m =>
         {
                m.info = DoMagicStuffHere(resp);
         });
     }
...
}

This is what the system.serviceModel looks like in the App.Config

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IAccountService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="false">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
                    <message clientCredentialType="UserName" algorithmSuite="Default"/>
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://yadayafa/accountservice.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAccountService" contract="AccountService.IAccountService" name="BasicHttpBinding_IAccountService"/>
    </client>
    </system.serviceModel>
Dennis Skantz
  • 363
  • 2
  • 8
  • What version are you running? I just ran this on NSB 2.5 with no issues. – Adam Fyles May 31 '11 at 19:29
  • Visual Studio 2010, 3.5 framework, NSB 2.5, Win7. – Dennis Skantz May 31 '11 at 19:52
  • Update: I took the PubSub sample and added a line of code in the Handler to create a Client. At home this works well, on the computer in the office it hangs :-(... It must be some kind of configuration on my workcomputer that jinxes the instatiation of the WCF client inside NServiceBus.Host.Exe – Dennis Skantz Jun 01 '11 at 10:03
  • Just to support your hypothesis, I tried it on the same configuration and everything worked. – Adam Fyles Jun 01 '11 at 13:16

0 Answers0