1

WCF does not support request streaming (aka streaming upload of large data) over HTTP with HTTP authentication. My first guess was it is because of authentication handshake causing the streaming request to be send twice to the server. But that is also the case for large request in buffered mode so it doesn't make sense.

You can easily implement request streaming with HTTP authentication in custom ASP.NET http handler. If you have control over the client you can even avoid "multiple requests problem" by doing explicit HTTP HEAD to pre-authenticate to server and then reuse persistent connection to do the actual streaming request with HTTP POST.

So can anybody think of the reason(s) WCF not supporting this? (other than no time to do that)

Thanks

Peter Sladek
  • 900
  • 9
  • 8

1 Answers1

1

The reason is that you must first send the whole request (even streamed) to get HTTP 401 and follow security handshake and finally send the whole request again. Because streaming is supposed to be used with very large messages this process can be very slow and add unwanted traffic over the network so MS probably did design decision to not allow it at all.

The trick with HEAD request is not implemented in WCF.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • I think I can accept that answer :) Hopefully there will be a configuration override to enable this in next version of WCF. Out of curiosity: Can you think of an EASY way to override this right now? I mean on the server side to override some method to enable request streaming and on the client proxy to override some method to insert my HEAD request prior to actual request? – Peter Sladek Oct 07 '11 at 14:51