ptkvsk
ptkvsk

Reputation: 2222

How to get server endpoint address from client callback method (wcf duplex contract)

I have a duplex WCF contract and I want to get server endpoint address from client callback method (I'm using single client and many servers, so I want to know which server responds to me). Is there a way to get it from the OperationContext?

public class CallbackService : IServiceCallback
    {
        public void OnSuccess()
        {
            string endpoint = OperationContext.Current.?
            MessageBox.Show(string.Format("Process on {0} successfully finished!", endpoint));
        }
    }

I saw this question and tried the solution, but it responds with something unmeaningful to me: "fe80::1845:e7eb:abbb:77aa%13".

And here is what I want to get:

<endpoint address="http://localhost:5678/WinFormsHoster/wsDual">

Thanks in advance!

Upvotes: 0

Views: 1213

Answers (1)

flayn
flayn

Reputation: 5322

That is the correct address, you are using IPv6.

Upvotes: 1

Related Questions