I have an already running basicHttpBinding with transferMode=Buffered WCF service for sending small amount of data from client.
Now, as part of enhancement, need to upload multiple images with each image of size around 5-10 MB.
I am planning to implement streaming for uploading the large files (file by file).
My questions
1. Can the buffered and Stream TransportMode exists side by side?
2. Can I use the same configuration? (end-point, Binding, etc) for buffered and streamed
3. Do I need to have separate service contract and can it be part of the existing service contract?
4. Can I have sample working code?
5. I am open to adopt, if you have any other better suggestion.
You can have one contract with some operations that use streaming and some that don’t.
However, Learning WCF book advises to have separate contract with streaming operations. This way you have separate endpoint with binding that has
TransferMode=Streamed.For sample working code – you only need to set
in binding configuration and your contract operations must have only Stream as a parameter (or return type)