Beginners WCF Question - Consumable asynchronous services

后端 未结 2 737
情歌与酒
情歌与酒 2021-02-10 15:53

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

2条回答
  •  孤街浪徒
    2021-02-10 16:19

    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)

提交回复
热议问题