I just wanted to share a rather lengthy lesson I learned yesterday afternoon. We were trying to parse the contents of an input stream coming in via filepolling. We were polling our filesystem for new files that were dropped there by an internal partner. We essentially wanted to pass that file (stream) in its entirety to the TN, but first we needed to read its contents to decided who the sender and receivers were. We tried to pass ffdata (the input stream variable from the file polling) to pub.io:streamToBytes and then the output of that to pub.string:bytesToString… then we parsed that string, set the correct sender and receiver… then tried to pass the original ffdata (which essentially wasn’t edited) to wm.EDIINT:send to submit it to TN.
We couldn’t understand why the stream seemed to be corrupted by “touching it” in this manner. We never overwrote ffdata, but when it was passed through the whole process it was missing quite a bit of the original stream. After struggling with this for several hours we decided to rebuild the stream from the string we parsed. So we used the services above in reverse order, rebuilt the stream, and used that stream to submit it to the send service. (to TN)… This finally worked.
So if there is anyone out there who doesn’t understand why a stream is missing information, just remember you can’t touch it or you need to rebuild it!