gpt4 book ai didi

silverlight-4.0 - 自定义 WCF RIA 服务终结点

转载 作者:行者123 更新时间:2023-12-03 17:59:56 25 4
gpt4 key购买 nike

是否可以自定义 WCF RIA 服务端点的参数?具体来说,我想为端点创建一个自定义绑定(bind)并增加 maxReceivedMessageSize允许发送大小为几兆字节的文件的内容。

我尝试干预 web.config,但出现以下错误:

[InvalidOperationException]: The contract name MyNamespace.MyService could not be found in the list of contracts implemented by the service MyNamespace.MyService



网络配置
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinaryHttpBinding">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<services>
<service name="MyNamespace.MyService">
<endpoint address="" binding="wsHttpBinding" contract="MyNamespace.MyService" />
<endpoint address="/binary" binding="customBinding" bindingConfiguration="CustomBinaryHttpBinding" contract="MyNamespace.MyService" />
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>

最佳答案

我们有一个类似的问题 - 我们想使用 WCF-RIA 服务调用操作将大型位图从 Silverlight 客户端发送到服务器。

Web.config 中的以下更改对我们有用:

<httpRuntime requestValidationMode="2.0" maxRequestLength="6225920"/>

How to configure Parameter/Message length for WCF-RIA-Service operation

关于silverlight-4.0 - 自定义 WCF RIA 服务终结点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3025399/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com