【发布时间】:2011-06-26 08:04:39
【问题描述】:
我正在尝试将 WCF 端点行为添加到我的 Silverlight 客户端。但是我在运行时收到以下错误:
Unrecognized element 'behaviors' in service reference configuration.
Note that only a subset of the Windows Communication Foundation
configuration functionality is available in Silverlight.
WCF 端点不能在 Silverlight 中扩展是真的吗?下面列出了我的 ServiceReferences.ClientConfig 文件,显示了我如何尝试添加名为 MyBehaviorExtention 的扩展:
<configuration>
<system.serviceModel>
<extensions>
<behaviorExtentions>
<add
name="MyBehaviorExtention"
type="MyTest,
MyBehaviorExtention,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=null" />
</behaviorExtentions>
</extensions>
<behaviors>
<endpointBehaviors>
<behavior name="MyBehavior">
<MyBehaviorExtention />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding
name="MyWebServicePortBinding"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint
name="MyWebServicePort"
address="http://localhost:8080/MyService"
binding="basicHttpBinding"
bindingConfiguration="MyWebServicePortBinding"
contract="MyServiceReference.MyWebService"
behaviorConfiguration="MyBehavior" />
</client>
</system.serviceModel>
</configuration>
【问题讨论】:
标签: silverlight wcf wcf-binding