开发者

calling wcf service without waiting for response from console application

开发者 https://www.devze.com 2023-01-07 19:12 出处:网络
I presume , such a mode should exist. Just triggering WCF service and exiting. Something else will check a log ( database/file ) produced by WCF service. My understanding it is d开发者_如何学Goifferen

I presume , such a mode should exist. Just triggering WCF service and exiting. Something else will check a log ( database/file ) produced by WCF service. My understanding it is d开发者_如何学Goifferent to asynchronous call where calling application allows to do something else, but still runs some code on completion event.


Your optimal solution would be an asynchronous one-way call.

The one-way part of it says that you want to call the method, but don't expect any result back. See What You Need To Know About One-Way Calls, Callbacks, And Events for more details on that part.

The asynchronous part of it makes sure your call returns right away - not waiting for the service-side to pick up your message.

So basically you need:

[ServiceContract]
public interface IMyService
{
   [OperationContract(IsOneWay=true)]
   public void OneWayCall()
}

and then call this in an asynchronous matter.

0

精彩评论

暂无评论...
验证码 换一张
取 消