WCF 服务的流式输出 [英] Streamed output from a WCF service

查看:43
本文介绍了WCF 服务的流式输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 WCF 服务获取流式输出.

I am trying to get streamed output from a WCF service.

我已将 transferMode 设置为StreamedResponse".当客户端从服务器接收到流时,它无法读取流.从服务器端调试时,我可以看到流有数据,但从客户端 stream.Length 抛出 NotSupportedException.将流读入缓冲区会导致读取 0 个字节.

I have set the transferMode to "StreamedResponse". When client receives the stream from server, it is unable to read the stream. While debugging from server side I can see that the stream has data, but from client side stream.Length throws a NotSupportedException. Reading the stream into a buffer results in 0 bytes read.

我使用 svcutil 生成了客户端代理,并且正在使用 .NET 3.0.有没有人遇到过类似的问题?

I generated the client proxy using svcutil, and am using .NET 3.0. Has anyone experienced a similar problem?

推荐答案

没有任何细节很难帮助,但请注意,VS2005 Cassini 服务器(asp.net 开发服务器)不支持通过 http 进行流式传输.

It is hard to help without any details, but note that VS2005 Cassini server (asp.net development server) doesn't support streaming over http.

这篇关于WCF 服务的流式输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆