Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am invoking event from DLL which in referred in my created WCF service.i am getting error from the wcf service when that invoking of event is handled in wcf .can you please suggest on how can i do a callback from dll to wcf and from wcf to client application.

What I have tried:

Event raising from DLL to WCF and event raising from WCF to WPF(Client)
Posted
Updated 10-Sep-19 4:05am
Comments
PureNsanity 10-Sep-19 12:35pm    
I'm not sure if you really need a callback here... You could just create a custom exception then have the client take action based on the exception type.
Member 13221327 11-Sep-19 4:30am    
i am getting the exception like mentioned below

This request operation sent to http://localhost:8750/ did not receive a reply within the configured timeout (00:00:29.9980053). The time allotted to this operation may have been a portion of a longer timeout. This may be because the service is still processing the operation or because the service was unable to send a reply message. Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.
PureNsanity 11-Sep-19 10:15am    
Have you tried increasing the OperationTimeout? Or does the call fail immediately?
Member 13221327 11-Sep-19 4:38am    
i need call back from WCF to wpf.......when event is raised from WCF it should be publised in C#-class

1 solution

you could use a dublexchannel where you can use a clientside-contract implementation to do the callback - please have a look at the examples for dublexchannels. But I wouldn't use dublexchannels because to keep them allive for a Long time you have to use kind of ping messages. So I use a push/push mechanism where i host a WCF Service on Backend and a one on the Client side. Register from Client throght backendservice (to know the address for the Client "broadcast" on the backend) - So i can push from Client to backend and vice versa… I do it like it's done for mobile phones. There is a central Service that does the actual push (like an Event) for all Clients and which can be used from the other Services. Also have a look at udp-discovery protocol (just add endpoints for it) so your Services/Clients could automatically discover there Counterparts inside a Network (only Intranet)
 
Share this answer
 
Comments
Member 13221327 11-Sep-19 4:42am    
This push is duplexchannel operation
johannesnestler 11-Sep-19 7:15am    
so you use a dublexchannel? I don't really understand you problem then. So to call a WCF Service on any envent should be easy, but to callback to a client from WCF-Service (could be any kind of application, WPF whatever) you need a dublex channel. So now you say you use a dublexchannel - so your problem is you don't know how to implement the client-side callback-contract? Please show your code or try to reforumlate your question… I answered to "can you please suggest on how can i do a callback from dll to wcf and from wcf to client application." I suggested not to use a dublexchannel…. so your Question is really "how to implement a callback with a dublex-channel"?

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