views:

11

answers:

1

Hi I want to create a vehicle insurance broker site which gets insurance prices from other insurances. Assuming all insurance companies will give their answer through some sort of web services I want to create another web service which will return unified answers with all data from insurers.

But there is a problem. Some insurers might answer quicker (slower) than others and in a best case I would like to display available prices to users as soon as they are received by my component. This means my component must be able to push answers to client as soon as it gets them from insurers.

Does WCF support scenario when it will send its response in parts when new part is available and then finishing with part that says that there are no more parts left?

A: 

WCF has an ability to "callback" the clients. Read more at Callback Operations. However what is "slower" in your application? If it takes minutes or hours to get an answer from third party the connection will time out. You might be better off with your app polling for new results.

Vitalik
Thank you. I learned something new from this article. Answering your question, it's not minutes or hours. For example one insurer might answer in a second and another in 10. I simply don't think it would be wise to present user results after 10 seconds when all insurers answered. Presenting user with what is available as quickly as I can seems like a better solution for me. Of course I could abandon use of services here at all and use asynchronous calls from my website but then I would loose clear boundary between presentation and aggregation layer.
Sergej Andrejev
I think in this case using callback and call it multiple times during those 10 seconds will work nicely.
Vitalik