指定ServiceBehavior和EndpointBehavior的语法?

时间:2012-06-11 18:18:47

标签: wcf web-services web-config servicebehavior endpointbehavior

查看http://msdn.microsoft.com/en-us/library/ms731303.aspxhttp://msdn.microsoft.com/en-us/library/ms789007.aspx,给出了指定ServiceBehavior的示例,但是有没有办法在behaviorConfiguration中指定endpointBehavior?像

这样的东西
  <service name="ServiceName1" behaviorConfiguration="ServiceBehavior1;EndpointBehavior1"> 
...
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior1">
...
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="EndpointBehavior1">
...
        </behavior>
      </endpointBehaviors>
    </behaviors>
...

1 个答案:

答案 0 :(得分:1)

愚蠢的问题,web.config的端点元素也有自己的behaviorConfiguration属性。

    <endpoint
      behaviorConfiguration="EndpointBehavior1" ...