wcf binding - Custom processing of CSV file via WCF -
I have a project through which I have a WCF service, which I basically leave the file in a specific directory are given. I have a basic custom transport channel argument that I published on the web, which is about transport on a file. However, there is another issue, the content of the file itself is going to be a comma-delimited file of the file data. For each line in the file, I want a specific method to apply to the service. This is the part with which I have trouble Has been there.
I understand that it will include a custom message encoder. Here is the napkin design behind me that encoder will receive a stream of data (read the file) from this file and create a message from it (I still do not talk a little bit on that part). Then, the fact is that in order to read in the stream, the more data file transport channel should tell it to read the second message from it.
Am I on the right track? The second question is how should my encoder handle the buffed calls. I get the value from an ArraySegment, so the only thing I can think is to modify the incoming array (I can not just manipulate the offset, it will not return to the original collar).
Thoughts? I know that this is a bit of a walking.
You can not do all that work in a message encoder because a strong message from WCF at that level, There is a message / one-message-out bias. In fact, both of you can keep your channel and your custom encoder to work together.
What I would like to do to keep it normally, it will be for the transport channel file, open it and read one record at a time, then to satisfy a received call () Produce a message at one time (via encoder).
For a way to deal with buffering, it is usually a drag, but the size of the encoder is basically allowed to set a hard border at the maximum size of any of the buffers allocated to you. (So you do not even try to process messages) This is not really a problem, straightforward, if you use the streaming interface, though.
Comments
Post a Comment