![](/img/trans.png)
[英]Using WCF, how can I make sure only trusted assemblies call my service?
[英]How can I make sure that the WCF service is always available for everyone?
这是我第一次使用WCF服务,对此有一些疑问。 我有一个项目布局,如下所示:
也,
我该如何实现?
作为新的WCF服务开发人员,除了查看有关WCF服务托管的常规信息之外,您还需要考虑以下服务方面:
实例化
实例化行为(通过使用ServiceBehaviorAttribute.InstanceContextMode
属性进行设置)控制如何创建InstanceContext
来响应传入的消息。
每个都有优点和缺点,因此您需要为服务方案选择适当的行为。
并发
并发是对任一时刻在InstanceContext中活动的线程数的控制。 这是通过将ServiceBehaviorAttribute.ConcurrencyMode
与ConcurrencyMode
枚举一起使用来控制的。
节流
ServiceThrottlingBehavior
类公开了可用于限制在应用程序级别创建多少实例或会话的属性。 使用此行为,您可以微调Windows Communication Foundation(WCF)应用程序的性能。
<serviceBehaviors>
<behavior name="ThrottledService">
<serviceThrottling
maxConcurrentCalls="n"
maxConcurrentInstances="n"
maxConcurrentSessions="n" />
</behavior>
</serviceBehaviors>
参考: https : //msdn.microsoft.com/en-us/library/ms731193%28v=vs.110%29.aspx https://msdn.microsoft.com/en-us/library/vstudio/ms735114%28v = VS.100%29.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.