Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 合同运营';下载流';自动模拟需要Windows标识_C#_Wcf_Impersonation_Chunking - Fatal编程技术网

C# 合同运营';下载流';自动模拟需要Windows标识

C# 合同运营';下载流';自动模拟需要Windows标识,c#,wcf,impersonation,chunking,C#,Wcf,Impersonation,Chunking,我最近更改了绑定配置,以允许在WCF服务中进行模拟。通过实现这一点,我需要使用缓冲的TransferMode.buffered而不是streamed。虽然这似乎在一段时间内解决了我的问题,但我注意到,当试图分配要在消息中传递的MemoryStream时,大型文件(>200MB)会引发异常。我的同事和谷歌让我相信分块就是答案,我已经尝试实现了这个示例的一个版本: 我修改了TCPChunkingBinding类,使其从BasicHttpBinding而不是Binding派生,并添加了我们在尝试分块

我最近更改了绑定配置,以允许在WCF服务中进行模拟。通过实现这一点,我需要使用缓冲的TransferMode.buffered而不是streamed。虽然这似乎在一段时间内解决了我的问题,但我注意到,当试图分配要在消息中传递的MemoryStream时,大型文件(>200MB)会引发异常。我的同事和谷歌让我相信分块就是答案,我已经尝试实现了这个示例的一个版本:

我修改了TCPChunkingBinding类,使其从BasicHttpBinding而不是Binding派生,并添加了我们在尝试分块之前使用的必要BasicHttpSecurity属性

以前使用BasicHttpBinding的所有端点现在都使用TCPChunkingBinding。以下是我对TCPChunkingBinding类所做的修改:

TcpChunkingBinding : BasicHttpBinding, IBindingRuntimePreferences

我得到的错误是

The contract operation 'DownloadStream' requires Windows identity for automatic impersonation. A Windows identity that represents the caller is not provided by binding ('TcpChunkingBinding','http://tempuri.org/') for contract ('ITestService','http://tempuri.org/'.
当我在示例中服务类的host.cs中调用host.open()时

基本上,我的问题是有人能帮我弄清楚如何让这个示例处理模拟和分块吗

在任何人回答之前,在尝试组块方法之前,我将所有缓冲区设置都设置为最大,并且由于模拟的必要性,我无法使用流传输模式。提前谢谢

The contract operation 'DownloadStream' requires Windows identity for automatic impersonation. A Windows identity that represents the caller is not provided by binding ('TcpChunkingBinding','http://tempuri.org/') for contract ('ITestService','http://tempuri.org/'.