I have a project whereby I have a WCF service that I basically want invoked whenever a file is dropped in a certain directory. I've got the basic custom transport channel logic that I saw published on the web that deals with transport over a file. However, there's another point, the content of the file itself. The file is going to be a comma-delmited file of data. For each line in the file, I want a specific method to be invoked on the service. This is the part I am having trouble with.
I do understand that part of this will involve a custom MessageEncoder. Here's my back-of-the-napkin design. The encoder will receieve a stream of data (the file). It will read one line from the file and create a Message from it (that part I'm still a little clueless on). Then, the fact that the Stream has more data to read should tell the file transport channel to read another message from it.
Am I on the right track? The other question is how my encoder should handle buffered calls. I get in an ArraySegment by value, so the only thing I can think of is to modify the incoming array (I can't just manipulate the offset, it won't get back to the original caller).
Thoughts? I know this is a bit of a ramble.