WCF Webservice and data corruption
I have a List<string>
of files that needs to be retrieved from a web service. The Retrieval method RetrieveFileAsync(string fileName)
for a single file is called asynchronously. Since there can be corruption of file, the response from the webservice includes an MD5 checksum for that file. What is the best way I can fetch all the files from the service assuming corruptions occur. I'm开发者_高级运维 thinking of maintaining a Dictionary<string, bool>
that is marked if the checksum matches and repeatedly checking the dictionary items and issuing RetrieveFileAsync
for all files that are unmarked, until all files in the dictionary are marked. Is that the right approach.
If you expecting data corruption between service and client you can try to switch on the Reliable Message Delivery. This should fix any corruption on messaging level:
<wsHttpBinding>
<binding configurationName="myReliableBinding">
<reliableSession enabled="true" ordered="true" />
</binding>
</wsHttpBinding>
You can read more here.
精彩评论