Click here to Skip to main content
14,298,693 members
Rate this:
Please Sign up or sign in to vote.
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 5 days ago
   
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 5 days ago
   
Have you tried increasing the OperationTimeout? Or does the call fail immediately?
Member 13221327 5 days ago
   
i need call back from WCF to wpf.......when event is raised from WCF it should be publised in C#-class

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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)
   
Comments
Member 13221327 5 days ago
   
This push is duplexchannel operation
johannesnestler 5 days ago
   
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100