isoneway

How to find out whether current method is flagged with IsOneWay

落花浮王杯 提交于 2020-01-04 14:12:07
问题 Is there a way to know whether the currently executing WCF method is a OneWay method? I'm using httpBinding and the question relates to the server side. I searched in properties for OperationContext on MSDN and couldn't find it. EDIT : I used the following check: HttpContext.Current.Response.StatusCode != (int)System.Net.HttpStatusCode.Accepted; In case of OneWay calls the status code will be 202, but it's not a good way. Are there any better ways? 回答1: The WCF way to solve this is to: Create

What happens in WCF to methods with IsOneWay=true at application termination

徘徊边缘 提交于 2019-12-23 13:14:17
问题 I have a client application that once in while notifies about its progress a service. The method call to the service is marked with IsOneWay=true, because the notification doesn't need any return value and I don't want to delay. The client may notify about errors to the service, and afterward it terminates. The question is: does a oneway method call returns to the caller code after it sent the message? or it queues the message and later on it is sent by another thread? The two processes (the

WCF Service - setting IsOneWay=true still results in waiting client

不想你离开。 提交于 2019-12-11 07:24:16
问题 For seme of my service methods, client application needn't wait for any response to be sent over, So I just decorated these methods with IsOneWay=true , so they look like: [OperationContract(IsOneWay=true)] void MethodName(string param1, int param2) Now, when I call this method from client application, it still seems to wait for the method to complete processing. Am I missing something? 回答1: This may not be the case here and I don't know how your particular service is configured, but if you