Question

I have a server/client WCF app with calls from client to server and callbacks from server to client.

I'm getting some kind of error when I try to do the callback. But the info I get is useless, so they give you the tip to set the exception Detail In Faults to true to see more details.

I have this but I dont know how to include other behaviour since only 1 is allowed.

                    ServiceMetadataBehavior smb1 = host.Description.Behaviors.Find<ServiceMetadataBehavior>();
                    // If not, add one
                    if (smb1 == null)
                        smb1 = new ServiceMetadataBehavior();
                    smb1.HttpGetEnabled = true;
                    host.Description.Behaviors.Add(smb1);

I also want to let know the way I'm using the callbacks. When the client calls the server, my function in the server does all the stuff I need and saves the channel:

callbacks = OperationContext.Current.GetCallbackChannel<IServiceCallbackContract>();

And then when I need to call the client from the server, I use that channel. BUT NOT IN THAT FUNCTION!

I thought this couldn't be done but I saw it in some examples. So maybe I'm doing something wrong there too and you only can do the callback within the function in the server called from the client and which interface specifies the interface callback contract.

Was it helpful?

Solution

Finally got it working that way, just saved the channel and answered when I need in other function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top