Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

How to create a callback listener web api using .net core.

What I have tried:

--------------------------------------------------------------------------------------------
Posted
Updated 26-Feb-21 9:32am

1 solution

WebAPI's don't do callbacks. They typically run over HTTP, which is a request/response system.

Your code makes a request to a URL and the server does something and returns a reply. It's an "I'll call you" kind of thing, not the "server calls you".

To do something like this, you'd need something else that can call your app from the server, like SignalR[^].
 
Share this answer
 
Comments
Kumar Veerabadran 26-Feb-21 15:38pm    
Hi Dave, Thank you for reply.


I have subscribed with EWS with push notification as below:
public Microsoft.Exchange.WebServices.Data.PushSubscription SubscribeToPushNotifications (System.Collections.Generic.IEnumerable<microsoft.exchange.webservices.data.folderid> folderIds, Uri url, int frequency, string watermark, params Microsoft.Exchange.WebServices.Data.EventType[] eventTypes);

Here,
Uri
The URL of the web service endpoint to which the server should push events.

So my assumption was, EWS server will push the notification by request to given webservice URL. So how to write for EWS client webservice to received the push notification.
Dave Kreskowiak 26-Feb-21 15:43pm    
THIS should have been your original question. Not the simplistic vagary you posted.

You never mentioned you're working with EWS and that changes liuterly EVERYTHING about your question.

I haven't worked with EWS, so there's nothing I can tell you.
Kumar Veerabadran 26-Feb-21 15:50pm    
Oh ok Dave... Anyhow thanks for your reply :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900