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