ServiceBehaviour attribute allows you to specify behavior. In your case for single thread you would use following:
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerCall)]
public class Service : IService
{
}
You might want to read about different InstanceContextMode
s to help you better choose on how you want service to behave.
You also need to add to your app.config
new service behavior (or edit existing one):
<behavior name="wsSingleThreadServiceBehavior">
<serviceThrottling maxConcurrentCalls="1"/>
</behavior>
and in your behavior configuration in same app.config
set behaviorConfiguration like following:
<service behaviorConfiguration="wsSingleThreadServiceBehavior" name="IService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsEndpointBinding" name="ConveyancingEndpoint" contract="IService" />
</service>
Hope this saves you some time