试试下面两种思路
可以分批次请求,一次返回一部分。 一般来说10M以内都是可以接受
服务器端返回一个文件,客户端直接接受文件。(这里接受文件肯定要用流的形式,不能用byte数组)
我之前写的一个实验是soap机制的,你看可以么,以下是实验内容Web service 其运作原理如下 (下图引用官方网站简介):
+--------------------------------------+
web service registry
(aka service broker)
(UDDI)
+--------------------------------------+
^ ^
(2) (1)
(the client (the web service
WSDL finds the WSDL provider publishes
service the web service)
they want)
v v
+-----------+ +-----------+
service <--soap-->service
requestor provider
+-----------+ (3) +-----------+
(1) 发布 Web Service.
(2) 寻找已发布的 Web Service.
(3) 通过 SOAP 互相沟通.
(1) 及 (2) 均为 optional.
WSDL -- Web Services description Language. WSDL 描述 web service 的功能.
UDDI -- Universal Description, Discovery and Integration. 发布 web service 的协定.
SOAP -- Simple Object Access Protocol. SOAP 通过 HTTP 传送 XML message.