Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Conflict with WCF

$
0
0

Hello,

I've a console app with this code :

QueueClient Client = QueueClient.CreateFromConnectionString(connectionString, queueName);

ManualResetEvent CompletedEvent = new ManualResetEvent(false);

OnMessageOptions options = new OnMessageOptions();
options.AutoComplete = true;
options.MaxConcurrentCalls = 1;
options.ExceptionReceived += LogErrors;

Client.OnMessage((receivedMessage) =>
{
    try
    {
        var wcfSrv = new UserService.UserServiceClient();
        var response = wcfSrv.CreateActivationCode("code", new Guid(), "CODE_TYPE", 2);
        receivedMessage.Complete();
    }
    catch (Exception ex)
    {
        receivedMessage.DeadLetter();

    }
}, options);

Client.Close();
CompletedEvent.Set();

I don't know why the console crash out on :

var wcfSrv = new UserService.UserServiceClient();

It seems that I can't call a WCF service when i'm reading a queue ?


Thanks in advance for help



Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>