将传输模式更改为“流式传输”后无法加载 WCF Restful 帮助页面
在我的项目中,有一个 wcf Restful 服务,它允许用户将照片上传到 Web 服务。
更改配置设置以允许大文件上传后。 (添加绑定配置,即“TransferMode”、“BufferSize”等) 所有运营合同均按预期运行。
但是,端点的服务帮助页面停止工作。
一旦我删除端点上的绑定配置设置,帮助页面就会返回,
如何修复此问题?我在哪里错过了
谢谢大家
<bindings>
<webHttpBinding>
<!-- buffer: 64KB; max size: 64MB -->
<binding name="StreamedBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" transferMode="Streamed"
maxBufferPoolSize="67108864" maxBufferSize="65536" maxReceivedMessageSize="67108864">
</binding>
</webHttpBinding>
</bindings>
<service name="WCFRestFul.ApiRestful">
<endpoint address="" binding="webHttpBinding"
bindingConfiguration="StreamedBinding" bindingName="StreamedBinding"
contract="WCFRestFul.IApiRestful" behaviorConfiguration="web" />
</service>
更新: 我认为这不仅仅是因为传输模式,也许还有其他一些设置。 一旦我删除上面代码中的“bindingConfiguration”,服务帮助页面就会返回。 我有 2 个端点。另一个端点没有“绑定配置”,并且服务帮助页面可以正常工作。 我肯定错过了这里的一些东西,也许是一些简单的东西。 任何帮助将不胜感激
In my project, a wcf restful service, which allow users to upload photos to the web service.
After changing config settings to allow large file upload. (add binding configuration, i.e. "TransferMode", "BufferSize", etc.)
All Operation contracts are all working as expected.
However, the service help page for the endpoint stopped working.
The help page comes back, once I remove the binding config setting on my endpoint
How can I fixed this?? where did i missed
thank you all
<bindings>
<webHttpBinding>
<!-- buffer: 64KB; max size: 64MB -->
<binding name="StreamedBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" transferMode="Streamed"
maxBufferPoolSize="67108864" maxBufferSize="65536" maxReceivedMessageSize="67108864">
</binding>
</webHttpBinding>
</bindings>
<service name="WCFRestFul.ApiRestful">
<endpoint address="" binding="webHttpBinding"
bindingConfiguration="StreamedBinding" bindingName="StreamedBinding"
contract="WCFRestFul.IApiRestful" behaviorConfiguration="web" />
</service>
Update:
I think it is not just because of the transfer mode, but maybe some other setting as well.
The service help page comes back once I remove the "bindingConfiguration" in the code above.
I have 2 endpoints. The other endpoint don't have the "bindingConfiguration", and the service help page works fine on that.
I definitely missed some thing here, maybe some thing simple.
any help will be greatly appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我采纳了 carlosfigueira 的建议,痛苦地一次删除了一个配置设置。
我将配置设置从
旧代码
更改为最终工作版本(transferMode="Streamed"已删除),
最后服务帮助页面又回来了。
但是我不明白为什么它会恢复与关闭的原因相同。
无论如何,这是适合我的情况的可行解决方案。
希望有人会觉得它有帮助。
I took carlosfigueira advice, painfully removed my config setting one at a time.
I changed my config settings from
OLD Code
To Final working version (transferMode="Streamed" is removed)
finally the service help page is back.
However I can't understand why it is back same as why it was turned off.
anyway, this is the working solution for my case.
hope someone would find it helpful.
你说它停止工作是什么意思?在下面的示例中,服务仍然返回帮助页面(我尝试使用 IE 和 Chrome,他们能够看到该页面)。
What do you mean by saying that it stops working? In the example below the help page is still returned by the service (and I tried using both IE and Chrome, and they were able to see the page).