Why do we need ListenURI? RRS feed

  • Question

  • I am having hard time understand why do we need to use ListenURI. I cannot fine any good literature on web. I hope someone will be able to answer it here.

    Also, when a WCF service receives a SOAP message, it will try to match the <To> header with the address specified in the configuration (in <endpoint> element). If this does not match, it will throw an error, is that correct?

    Friday, April 1, 2011 2:31 PM


  • Hi Maulik,

    ListenUri is the actual Uri a channel on the service side will listen on; if omitted it will default to the address of the service endpoint the channel is associated to. You can also listen for more than one service endpoint over the same channel (as shown here: http://msdn.microsoft.com/en-us/library/aa395210.aspx); the channel will listen at the specified ListenUri for messages addressed to different endpoints.

    As for the second part of you question, by default wcf will try to match both the To header, with all the addresses of the endpoints associated with the channel the message is received through, and the Action header with all the Initiating actions of the contracts exposed via such endpoints. This process happens in the message filtering stage and is described in much more detail in the Custom Message Filter sample (http://msdn.microsoft.com/en-us/library/aa717046.aspx), which shows you also how to customize message filtering.



    Antonello Tesoro .Net Enterprise Software Architect
    • Marked as answer by Maulik Patel Monday, April 4, 2011 3:02 PM
    Friday, April 1, 2011 3:45 PM