tags:

views:

58

answers:

2

We have a reporting solution that works like this.

  1. User order the report to be created and teh service method returns
  2. Report is created (this can take a while) as a file
  3. Client app polls to see if the report is finished
  4. The clientet app asks to get the finished report

The report can be of the types xml, xls, txt, etc.

What is best practice for giving that 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 wantto return it in a DTO?

A: 

You could use netTcpBinding or netPeerTcpBinding for WCF Services for transfering files.

Look here for comparison: http://www.pluralsight.com/community/blogs/aaron/archive/2007/03/22/46560.aspx

Timotei Dolean
+1  A: 

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

marc_s