.net WCF Web服务,用于发送和接收大字节[]';s
我已经阅读了很多关于这方面的帖子,并收到了相互矛盾的信息——我试图“概括”一些其他人提出的问题,希望在网络上的某个地方能有一个清晰的答案:-) 我正在为连接到运行ASP.NET的IIS Web服务器的PC编写.NET应用程序。Web服务器有两种类似于的方法:.net WCF Web服务,用于发送和接收大字节[]';s,.net,asp.net,wcf,web-services,web-applications,.net,Asp.net,Wcf,Web Services,Web Applications,我已经阅读了很多关于这方面的帖子,并收到了相互矛盾的信息——我试图“概括”一些其他人提出的问题,希望在网络上的某个地方能有一个清晰的答案:-) 我正在为连接到运行ASP.NET的IIS Web服务器的PC编写.NET应用程序。Web服务器有两种类似于的方法: [WebMethod] public byte [] GetFile(string file) { // simplified return File.ReadAllBytes(file); } [WebMethod]
[WebMethod]
public byte [] GetFile(string file)
{
// simplified
return File.ReadAllBytes(file);
}
[WebMethod]
public void PutFile(string file, byte [] data)
{
// simplified
return File.WriteAllBytes(file, data);
}
在客户机上,我希望使用大约4MB大小的缓冲区调用GetFile/PutFile
BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
binding.AllowCookies = true;
binding.OpenTimeout = ???;
binding.MaxBufferSize = ???;
binding.MaxReceivedMessageSize = ???;
onlineTransport = new RemoteObject.RemoteObjectSoapClient(binding, new EndpointAddress(BaseUrl + "/page.asmx"));
// Read a file
byte [] foo = onlineTransport.GetFile("foo.file");
// Write a file
onlineTransport.PutFile("bar.file", foo);
要求
根据您的代码,您正在使用ASP.NET web服务,因此您不能使用MTOM、二进制编码或流式传输 对于WCF服务: