locked
Best way of sending large data from WCF service RRS feed

  • Question

  • Hi All,

    I have developed WCF service and large amount of data from WCF service. I am sending the data in the form of Datatable. that means return type of WCF methods is Datatable.

    can somebody tell me what is the best way of sending large amount of data from WCF service?

    can data be sent in the form stream? if yes then how that will be handled at the client side?

    any example will help a lot.

    thanks in advance.

    Prabi

    Thursday, January 29, 2009 4:44 AM

All replies

  •  http://msdn.microsoft.com/hi-in/library/ms733742(en-us).aspx

    Please go through above mentioned link.

    Regards,

    Varun


    Varun | http://www.varunshesh.spaces.live.com
    Thursday, January 29, 2009 5:31 AM
  • Prabi,

        One thing to note is that the handling of the stream is part of the transport/wcf scaffolding. Your client (other than the configuration of the client endpoint) will be blissfully unaware of how the data was transported (stream, buffer, ??). It can simply handle the returned value and move along.

     

     

    Thursday, January 29, 2009 3:06 PM
  •  Thanks for the reply.

    When I change the TransferMode of WCF from Buffered to Streamed, it is taking much time.

    what i want is when the data is available with the service, client should be able to use it and WCF service can still sending the data which will be added to data of client.

    just like when execute select query in SQL 2008 which is fetching millions of records, records are displayed in the result pane while query is still executing.

    regards,

    Prabi 

    Friday, January 30, 2009 6:10 AM
  •  Hi,

    did you try to implement the Client calling asynchronously the wcfservice ? In this way your client can go on while the service end the data transfer and the callback method is called.. 

    Take a look of " How to : Call WCF Service Operations Asynchronously" here : 
    http://msdn.microsoft.com/en-us/library/ms730059.aspx
    Monday, February 2, 2009 5:44 PM
  • Hi,

    Even if I call WCF service method asynchronously, I can't use(Display) the data untill service sends all the data.

    how can use the data when service is still sending it?.

    regards,
    Prabi
    Thursday, February 5, 2009 4:28 AM