How to call a web service in fire and forget mode from ASP.Net

I have a web service that I want to call from one of my asp.net classes. I can successfully call my web service. But now I need to call this service asynchronously. I need to call it and DO NOT wait for the service to complete. I do not need to process the response from the service and I do not need to check if the service completed successfully. All I want to do is call the service and do my best.

+4
source share
3 answers

One way to implement the fire-and-forget approach is to use a property IsOneWayin an attribute OperationContract, for example:

[OperationContract(IsOneWay=true)]
public void SomeMethod(string someValue);

true, . , , , ref out ( ). , ( , , , ).

. OperationContractAttribute.IsOneWay Property.

+3

-.

AddServiceReference -> Advance -> generate asynchronous operations.

, ABC , , .

1>ABC (fire and wait for output)
2>ABCAsync(fire and forget)
3>ABC callback event(get fired <if ABCAsync is called> when data available in your application)
+4

Have you tried this :?

http://msdn.microsoft.com/en-us/library/bb885132(v=vs.110).aspx

this is another way to do this, check it out.

-1
source

Source: https://habr.com/ru/post/1524367/


All Articles