Print Page | Close Window

WCF Streaming Files

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1028
Printed Date: 10-Jun-2026 at 5:33pm


Topic: WCF Streaming Files
Posted By: Mike U
Subject: WCF Streaming Files
Date Posted: 18-Dec-2008 at 12:59pm
I'm trying to implement a file transfer mechanism client<->server via Wcf.  Our first attempt using chunking and InvokeServerMethod() was very slow.  After some research, it sounds like a more efficient approach is to use a transferMode="Streaming".
 
According to MS http://msdn.microsoft.com/en-us/library/ms789010.aspx%20 - http://msdn.microsoft.com/en-us/library/ms789010.aspx  In order to make this work I have to have a [ServiceContract] with a method with one parameter of type Stream.  I can get this working in a standalone Wcf application, however I'm affraid I might be stuck trying to get this integrated into our Ideablade application.
 
Since the BOS is only listening for the WcfPersistenceServer, I won't be able to get my methods hosted by the BOS.  Is this correct?  If so is there anyway arround this other than having my own Service listening?
 
In short here is what I need.  The BOS to call my method (eg. SendFile(Stream fileStream)) not through InvokeServerMethod() which would not support a streaming protocol.
 
I know not an easy question.  Any Wcf experts want to share?



Replies:
Posted By: kimj
Date Posted: 18-Dec-2008 at 2:29pm

You're correct that you won't be able to host your methods in the BOS itself.  Making the service contract and implementation extensible is an interesting idea, but probably not something we could pursue any time soon.

If calling your service methods from the BOS via a method called by InvokeServerMethod isn't feasible - I assume because you still have the issue of collecting the data for a non-stream return object - then you could make the call directly from your client application.   Especially since the data you're returning seems a bit out-of-band from your business objects and domain model, this seems like a cleaner design too.
 


Posted By: Mike U
Date Posted: 19-Dec-2008 at 4:12am
Making the call from the client application sort of misses the point.  I need to move files from client to server, so I'd need something on the server side to receive the file for later processing by a server side app. 
 
Thanks for the interest though.



Print Page | Close Window