silverlight-4.0 – 自定义WCF RIA服务端点

silverlight-4.0 – 自定义WCF RIA服务端点,第1张

概述是否可以自定义WCF RIA Services端点的参数?具体来说,我想为端点创建自定义绑定,并增加maxReceivedMessageSize以允许发送大小为几兆字节的文件的内容. 我已经尝试插入web.config,但是我收到以下错误: [InvalidOperationException]: The contract name MyNamespace.MyService could not 是否可以自定义WCF RIA Services端点的参数?具体来说,我想为端点创建自定义绑定,并增加maxReceivedMessageSize以允许发送大小为几兆字节的文件的内容.

我已经尝试插入web.config,但是我收到以下错误:

[InvalIDOperationException]: The
contract name Mynamespace.MyService
Could not be found in the List of
contracts implemented by the service
Mynamespace.MyService

web.config中

<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服务端点全部内容,希望文章能够帮你解决silverlight-4.0 – 自定义WCF RIA服务端点所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1006558.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存