"SB" <SB@discussions.microsoft.com> wrote in message
news:A7**********************************@microsof t.com...
I am implementing a web services and one of its methods can potentially
return Gb of data. I would like this to be implemented in an 'iterator'
kind of style. With this the client can get the count first and then use a
method to get certain number of records at a time.
My initial idea was to have one web method to return the count of records.
Another web method to return a user spcified number of records and have a
boolean flag to let the client know the last set of records or no more
records. I am thinking of maintaining the state and make this a stateful
web service. I am not sure whether this is the correct way of doing it.
This is certainly one way of doing it. The Google web service does it this
way too: you pass the index of the first desired search result and the web
service returns you 10 subsequent search hits. To get the next 10, you
increment the index by 10 and call the web service again. Note that the web
service does not need to maintain state for this to work since all the
necessary information is provided by the client in the call.
Another idea that comes to mind would be to simply return an Url (e.g.,
http://myserver/mybigdata.file) from the web service. The consumer could
then download the data using e.g., HTTP (with the WebRequest et al classes).
I also heard somewhere about the 'conversational web services'. Is that
something really exist and with .NET?
'Conversational web services' might refer to the WS-SecureConversation stuff
in WSE which is about securing multiple calls (i.e., a conversation) between
a consumer and a web service, rather than transferring a GB of data.
Regards,
Sami