i have two methods in Icontact and wcf service, i want to version one method for new requirement. and want existing clients to call old code. and new client to call the new changed method and existing method for backward compatibility.
code:
[ServiceContract(Namespace = "http://www.testk.com/1/11", Name = "cService")]
public interface ICService
{
[OperationContract(Name="GetWorkingDetails")]
void GetWorkingDetails(int a);
void GetList(int a);
}
//service Implementation
public class MyService : ICService
{
[WebGet]
void GetWorkingDetails(int a)
{
////
}
[WebGet]
void GetList(int a)
{
////
}
}
here i am versioning.....
[ServiceContract(Namespace = "http://www.testk.com/2/11", Name = "cService")]
public interface ICServicev1
{
[OperationContract(Name="GetWorkingDetails")]
void GetWorkingDetailsV2(int a);
}
<endpoint address="" behaviorConfiguration="AjaxBehavior"
binding="webHttpBinding" bindingConfiguration="" name="v0"
contract="ICService" />
<endpoint address="r1" behaviorConfiguration="AjaxBehavior"
binding="webHttpBinding" bindingConfiguration="" name="v1"
contract="ICServicev1" />
When I call the existing method it works great, also when I call service.svc/r1/GetWorkingDetails
it works great. But I want to also call service.svc/r1/GetList
which is in previous contract. How can I call this for backward compatibility.
Thx