问题
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 try and close the channel used to call the method then the Close call will block until the operation has completed on the server - some more info in this blog post.
回答2:
Have you updated the service reference?
If your client code does not know that the attribute has been added it will not react to it.
来源:https://stackoverflow.com/questions/2176701/wcf-service-setting-isoneway-true-still-results-in-waiting-client