problem with addressfilter in WCF

Posted by Zé Carlos on Stack Overflow See other posts from Stack Overflow or by Zé Carlos
Published on 2010-03-31T18:17:47Z Indexed on 2010/03/31 18:23 UTC
Read the original article Hit count: 566

Filed under:
|
|

I've build my own WCF channel with all necessary stuff (like encoders, bindings, etc) to use it with ServiceHost.

I just want to build the "channel stack" making no custumizations at "Service Model". To acomplish this, my encoder returns perfect ServiceModel.Messages with a XML infoset just like other channel does.

Lets assume the following service implementation:

[ServiceContract(Namespace = "http://MyNS")]  
    public interface IService1
{
    [OperationContract(IsOneWay = true)]
    void dummy();
}

public class Service1 : IService1
{
    public void dummy()
    {
        Console.WriteLine("In Service1:dummy()");
    }
}

I used this service through other bindings and traced the following ServiceModel.Message contents (SOAP format):

    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
        <s:Header>
               <a:Action s:mustUnderstand="1">http://MyNS/IService1/dummy</a:Action>
               <a:To s:mustUnderstand="1">amqp://localhost</a:To>
        </s:Header>
        <s:Body>
              <dummy xmlns="http://MyNS"></dummy>
        </s:Body>
    </s:Envelope>

Then (just to debug) i changed my encoder to allways return this message. When i use my custom channel the WCF's runtime replay with an faul message telling:
"The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree."

I read that the default EndPointDispatcher.AddressFilter simply looks to the "TO" header and delivery the message to corresponding service. This is happening with other bindings, why not happens with my custom channel too?

Is there any way to i check what default AddressFilter is doing?

Thanks

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wcf