We have a reporting solution that works like this.
- User orders the report to be created and the service method returns it
- Report is created (this can take a while) as a file
- Client app polls to see if the report is finished
- The client app requests the finished report
The report can be of the types xml, xls, txt, etc.
What is best practice for sending the report file to the client? I have seen a sample using REst and Stream, but that does not fit so well.
What datatype must we use if we want to return it in a DTO?
When returning files from WCF, I would recommend checking out Streaming Message Transfer.
This allows you to return files as a stream – rather than having to assemble them in full on your server before sending them back. This way, you can stream back even huge files without putting too much burden on your server.
Marc