Question of WCF for beginners - Services asynchronous consumables

advertisements

this is a more "can it be done" rather than a "how is it done" question. I'm looking at building a service (middle tier, .net, providing data abstraction and some business logic) that will be used by multiple internal client systems on different platforms. E.g. one client might be a web site, another client some java code, another client C#, etc.

I want to provide a synchronous and asynchronous API into my service, e.g. GetData, BeginGetData, EndGetData methods. I also want clients to be able to register for notifications of new "data" being added to the system. In the past I've implemented this using web services with a Tibco EMS channel for the notifications.

My question is: Could I achieve the three requirements (synch, asynch, and pub/sub) by exposing a WCF service? Could this service by consumed by non WCF clients?

Excuse the vagueness of this question - I can elaborate as needed.

Thanks in advance.


Methods are synchronous by default. To make them asynch, you need to add this attribute [OperationContract(AsyncPattern=true)] and return an IAsynchResult, just like you would if you were doing BeginIvoke() with winforms. (read more here http://msdn.microsoft.com/en-us/library/ms734701.aspx)

You can do publish/subscribe with something called a Callback Contract (although im not sure about implementing this in other platforms) I don't have much experience with these, but they don't seem hugely complected(you can read more here http://dotnetaddict.dotnetdevelopersjournal.com/wcf_alarmclock.htm)