2

something seems very wierd to me, I have tried to look inside WCF with Reflector but forgive me it's too hard to understand :(.

When client A call a duplex service on server B with wsDualHttpBinding, I was thinking that client A include the client base address (the address of the callback) in the header of the request like this

<a:ReplyTo>http://client.foo/29293-3287-2387-3291</a:ReplyTo>

.

But OperationContext.Current.IncomingMessageHeaders.ReplyTo returns null...

How wsDualHttpBinding is doing to know the address of the client channel ????

Is there some black magic or something ?

Solution

This is the reliable session which is responsible to transport the replyTo address. We can verify this with these binding elements in a customBinding

<reliableSession/>
<compositeDuplex/>
<oneWay></oneWay>
<textMessageEncoding></textMessageEncoding>
<httpTransport/>

Remove the reliableSession and your service have not the callback channel anymore...

Nicolas Dorier
  • 7,383
  • 11
  • 58
  • 71

2 Answers2

2

I think this information is passed via messages when establishing the session. If you use a tool like "fiddler" to watch all the http traffic, my hunch is you'll see it in an initial session setup message. No magic, the client has to tell the server 'where to call back'.

Brian
  • 117,631
  • 17
  • 236
  • 300
0

When I work with sockets, the caller's address is also available - my guess is that knowing to which address you'd need to reply to is a pretty low level feature of network communication...

flq
  • 22,247
  • 8
  • 55
  • 77
  • It can be possible in with a non duplex binding, but duplex binding use IOutputChannel/IInputChannel (the lowest level of abstraction of WCF) these channel can just recieve or send but not both, so I don't think it's here. I'm verifying with reflector maybe you are right. – Nicolas Dorier Mar 15 '09 at 21:56