开发者

WCF Callback Client Failing

I have created a WCF service which has a callback. I have created a sample client which will subscribe to these callbacks. I have been using the ListBasedPublishSubscribe sample as a base for this. However when I try and setup the unique callback address in the client with this code

        context = new InstanceContext(null, new MyClass());
        client = new MyClient(context);
        WSDualHttpBinding binding = (WSDualHttpBinding)client.Endpoint.Binding;
        string clientcallbackaddress = binding.Client开发者_StackOverflow中文版BaseAddress.AbsoluteUri;
        clientcallbackaddress += Guid.NewGuid().ToString();
        binding.ClientBaseAddress = new Uri(clientcallbackaddress);

The third line fails because client.Endpoint.Binding.ClientBaseAddress is null. Should this not be null (I assume so for the sample to work) and why is this the case in my app? Have I forgotten to do something?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜