AddressFilterMode Enum

Definition

Specifies the type of match semantics used by the dispatcher to route incoming messages to the correct endpoint.

public enum AddressFilterMode
Inheritance
AddressFilterMode

Fields

Name Value Description
Exact 0

Indicates a filter that does an exact match on the address of an incoming message.

Prefix 1

Indicates a filter does the longest prefix matches on the address of an incoming message.

Any 2

Indicates a filter that matches on any address of an incoming message. Using this value turns off the WCF address filter check. Any message, no matter what its WS-Addressing:To identity, is accepted.

Examples

[ServiceBehavior(AddressFilterMode = AddressFilterMode.Prefix)]
public class CalculatorService : ICalculator
{
    public double Add(double n1, double n2)
    {
        return n1 + n2;
    }

    public double Subtract(double n1, double n2)
    {
        return n1 - n2;
    }

    public double Multiply(double n1, double n2)
    {
        return n1 * n2;
    }

    public double Divide(double n1, double n2)
    {
        return n1 / n2;
    }
}

Remarks

The value of the AddressFilterMode enumeration is set on the ServiceBehaviorAttribute.AddressFilterMode property.

The longest prefix match criterion specified by Prefix requires that the destination address be matched by the largest number of leading address bits in the filter. The default value is Exact.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1