简体   繁体   中英

Redirect method call in wcf

How to redirect a wcf method call to another method in wcf.

lets say a user call wcf method GetDetail(para1,para2) and we redirect it to GetMyDetail(para1, para2) .

So basically for user its GetDetail method, but in wcf side instead of Getdetail method we will call GetMyDetail method and send result back to user.

on google i found some article saying that this can be achieve using IClientOperationSelector but was not able to found any example.

This is not for single method, a mapping will be written in webconfig/xml file for call forwarding method and parameters.

You can call this way

public int GetDetail(para1,para2)
{

   return GetMyDetail(para1, para2...)
}

or user function overloading

[OperationContract(Name="GetDetail")]
string GetMyDetail(int para1,int para2);
//Initail method
[OperationContract(Name = "GetDetail")]
string GetDetail(string para1, string para2);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM