How to deal with operation overloading while exposing the WCF services?
Submitted by: AdministratorBy default overload operations (methods) are not supported in WSDL based operation. However by using Name property of OperationContract attribute, we can deal with operation overloading scenario.
[ServiceContract]
interface ICalculator
{
[OperationContract(Name = "AddInt")]
int Add(int arg1,int arg2);
[OperationContract(Name = "AddDouble")]
double Add(double arg1,double arg2);
}
Notice that both method name in the above interface is same (Add), however the Name property of the OperationContract is different. In this case client proxy will have two methods with different name AddInt and AddDouble.
Submitted by: Administrator
[ServiceContract]
interface ICalculator
{
[OperationContract(Name = "AddInt")]
int Add(int arg1,int arg2);
[OperationContract(Name = "AddDouble")]
double Add(double arg1,double arg2);
}
Notice that both method name in the above interface is same (Add), however the Name property of the OperationContract is different. In this case client proxy will have two methods with different name AddInt and AddDouble.
Submitted by: Administrator
Read Online WCF SDK Job Interview Questions And Answers
Top WCF SDK Questions
☺ | How to set the timeout property for the WCF Service client call? |
☺ | What are contracts in WCF? |
☺ | How to configure Reliability while communicating with WCF Services? |
☺ | What is binding and how many types of bindings are there in WCF? |
☺ | How to deal with operation overloading while exposing the WCF services? |
Top Application Program Categories
☺ | AutoCAD Interview Questions. |
☺ | Microsoft Office Interview Questions. |
☺ | Microsoft Outlook Interview Questions. |
☺ | Microsoft Excel Interview Questions. |
☺ | WPF Interview Questions. |