WCF Web服务:上载文件,处理该文件,下载已处理的文件 [英] WCF Web Service: Upload a file, Process that file, Download that processed file back

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

问题描述

我可以处理文件部分的过程,但是在发疯之前,有人构建了一个简单的wcf服务&客户端(可以在Windows Services或IIS下运行)可以用来上传文件,然后下载该文件吗?用最少的代码行? (C#或VB)

I can handle the process that file part, but before I go crazy, has someone built a simple wcf service & client (running under windows services or IIS) that I can use to upload a file, and download that file back? with the fewest lines of code? (C# or VB)

压缩和压缩;加密会很酷,但是我稍后再讲!!

compression & encryption would be cool, but i'll layer that on later!!

谢谢!

推荐答案

您应该能够轻松地做到这一点。服务合同可能看起来像这样:

You should be able to do this fairly easily. The service contract would probably look like this:

[ServiceContract]
public interface IFileService
{
  [OperationContract]
  byte[] ProcessFile(byte[] FileData);
}

加密部分可以由WCF使用传输级安全性本地处理。我不相信WCF直接支持压缩,但是您可以使用GZipStream类添加压缩。

The encryption part could be handled natively by WCF using transport level security. I don't believe that WCF supports compression directly, but you could add that using the GZipStream class.

我没有像您描述的那样构建文件处理服务,但是我已经建立了一个服务来处理在WCF客户端和服务之间来回传递的字节数组数据的服务。它工作正常。

I have not built a file handling service as you describe, but I have built a service that handles byte array data that is passed back and forth between a WCF client and service. It works just fine.

这篇关于WCF Web服务:上载文件,处理该文件,下载已处理的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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