Can a web service return a stream?

前端 未结 12 1756
眼角桃花
眼角桃花 2021-02-02 09:23

I\'ve been writing a little application that will let people upload & download files to me. I\'ve added a web service to this applciation to provide the upload/download fun

12条回答
  •  终归单人心
    2021-02-02 09:50

    For WCF I think its possible to define a member on a message as stream and set the binding appropriately - I've seen this work with wcf talking to Java web service.

    You need to set the transferMode="StreamedResponse" in the httpTransport configuration and use mtomMessageEncoding (need to use a custom binding section in the config).

    I think one limitation is that you can only have a single message body member if you want to stream (which kind of makes sense).

提交回复
热议问题