I looks like that you can use IClientOperationSelector behaviour to select target method at runtime. e.g
public string SelectOperation(System.Reflection.MethodBase method, object[] parameters)
{
return "Sub";
}
With above implementation, Add call on the proxy can be changed to invoke Sub call on the service.
But this doesn't seem to work. It only works if I return "Add" from above method. For any other method name, it raise the exception. "NullObjectReference".
Does anyone has any idea about this
Thanka,
ZA

IClientOperationSelector Behaviour
Timiscool9999
Hi
If you return "Sub", WCF will try to find an operation called "Sub" in the proxy class. (Using the property "Name" in the OperationContractAttribute)
For example,
public interface ICalculator
{
[System.ServiceModel.OperationContractAttribute(Name="Sub", Action=http://Microsoft.ServiceModel.Samples/ICalculator/Add, ReplyAction="http://Microsoft.ServiceModel.Samples/ICalculator/AddResponse")]
double Add(double n1, double n2);
}
The name of the method does not matter in this case.
Regards,
Pablo