Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make asynchronous calls from a WCF client to WCF Service in parallel
    primarykey
    data
    text
    <p>I’m writing a service that has a call that is relatively long running. The client needs to be able to make successive requests that run in parallel to each other and for some reason my service will not execute them concurrently unless the calls are executed from separate clients. I'm trying to figure out what configuration setting(s) I'm missing.</p> <p>I’m using the netTcpBinding. My throttling configuration is:</p> <pre><code>&lt;serviceThrottling maxConcurrentInstances="10" maxConcurrentCalls="10" maxConcurrentSessions="10"/&gt; </code></pre> <p>The service contract:</p> <pre><code>[ServiceContract(CallbackContract=typeof(ICustomerServiceCallback))] public interface ICustomerService { [OperationContract(IsOneWay = true)] void PrintCustomerHistory(string[] accountNumbers, string destinationPath); } [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)] public class CustomerService : ICustomerService { public void PrintCustomerHistory(string[] accountNumbers, string destinationPath) { //Do Stuff.. } } </code></pre> <p>In the client, I’m making two successive asynchronous calls:</p> <pre><code>openProxy(); //call 1) proxy.PrintCustomerHistory(customerListOne, @"c:\DestinationOne\"); //call 2) proxy.PrintCustomerHistory(customerListTwo, @"c:\DestinationTwo\"); </code></pre> <p>On the service, the second operation begins only after the first one ends. However, if I execute both calls from separate clients, they both execute concurrently by the service.</p> <p>What am I missing? I had assumed that by marking my service class as “PerCall” that call 1 and call 2 each would receive their own InstanceContext and therefore execute concurrently on separate threads.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload