none
Via property on Channel creation RRS feed

  • Question

  • When creating a WCF channel, you have the option to provide a "Via" Uri.  If none is provided, the Via property is defaulted to the same as the EndpointAddress:
    ChannelFactory<T>.CreateChannel(Binding, EndpointAddress, Via)

    What is this property used for?

    The only documentation I can find is here:
    [https://msdn.microsoft.com/en-us/library/aa344554%28v=vs.110%29.aspx][1]

    > via
    >     Type: System.Uri
    >
    >     The Uri that contains the transport address to which the channel sends messages.


      [1]: https://msdn.microsoft.com/en-us/library/aa344554%28v=vs.110%29.aspx
    Wednesday, June 8, 2016 6:35 PM

Answers

  • Hi Splateaux,

    >> What is this property used for?

    The Uri of EndpintAddress is the logic address of service, and the Uri of via address is physical address. For server, via address is listen address, and for client, via address is the real destination address which the client sends to. By default, logic address and physical address are the same. But with Internet limit, we may need to split logic address and physical address. When we achieve load balance service, we will need an escrow service between client and server, escrow service is used to forward request from client to server according rules of the load balance. Now, the client will not send request directly to server, it will need to send to escrow service first by using via address, but the escrow service did not provide any service for client, so the EndpointAdress still should be server address.

    In conslusion, if you use EndpointAddress and Via, EndpointAddress is in the <To> header of SOAP, but the request is sent in Via address, if you use EndpointAddress only, EndpointAddress is in the <To> header of SOAP, and the request is sent in EndpointAddress.

    Best Regards,

    Tony


    Help each other

    • Proposed as answer by Fang Peng Tuesday, June 14, 2016 9:22 AM
    • Marked as answer by Splateaux Tuesday, June 14, 2016 2:50 PM
    Thursday, June 9, 2016 9:47 AM