0

I am unsure of whether this is possible and have conducted a handful of quick searches on the web and I don't think it is but here goes.

I have a web service (old school .asmx) which retrieves a list of items from a database. I want my client app to be notified if there are any items to be processed INSTEAD of the client app every so often making a request to the web service. Is this possible?

I know this is possible via WCF (duplex communication) however due to complications I can't use that approach.

Oops I just realised that I would also require the web service to poll itself or get something to call it asynchronously? Don't think this is a good solution...

Thanks in advance, Onam.

4

1 に答える 1

1

It is either polling (initiated by the client) or by maintaining a session like Exchange, Imap etc does. Classic .asmx communication is initiated by the client. Therefore it provides no events.

You can implement duplex yourself by developing a callback service hosted by your client. Your webservice can then invoke the callback client. However you must find a good solution to register and unregister the clients to the webservice.

Actually, I would not be a good idea to let the database invoke the items on each poll. You could cache the results in the logic layer referenced by the webservice. If you prefer the classic .asmx approach, you can create a bool method that checks whether new data is in the cache that is implemented by the logic. This would reduce the performance inpact, and then it won't be that bad to poll the server.

于 2013-01-15T10:41:57.610 に答える