1
我正在尝试向我的Silverlight客户端添加一个WCF端点行为。不过,我在运行时遇到以下错误:Silverlight客户端是否支持WCF行为?
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>
我的服务器是Java - 所以没有服务器端web.config。在客户端上,我只是试图添加一个消息检查器作为行为的端点。我能够以编程方式(在客户端)完成它,并想知道为什么我无法通过配置来完成它。 – Naresh 2011-02-14 20:11:24