WCF related Interview Questions

WCF is a programming framework used to build applicaions that inter-communicate. It is the part of the .NET Framework dedicated to communications. 
Go here  for more about WCF.

1.) How does Windows Communication Foundation address Service Oriented Architecture (SOA)?
WCF is the first programming model built from the ground up to provide implicit service-oriented application development, enabling developers to work autonomously and build applications that are more version independent, thereby increasing application resilience to change.
2.) How to deal with operation overloading while exposing the WCF services?
By default overload operations  are not supported in WSDL based
 operation. However by using Name property of OperationContract attribute, we can deal with operation overloading scenario. 

[ServiceContract] 
interface Isum 

[OperationContract(Name = "MultiplyInt")] 
int Multiply(int arg1,int arg2); 

[OperationContract(Name = "MultiplyDouble")] 
double Multiply(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 MultiplyInt and MultiplyDouble.

3.) Is Windows Communication Foundation going to interoperate with my existing applications?
The current plan is for Windows Communication Foundation to provide wire-level interoperability with WSE3, System.Messaging, .NET Enterprise Services, and ASMX applications. With minimal or no changes to code, applications built with these technologies will be able to call Windows Communication Foundation services and be callable by Windows Communication Foundation services.

4.) How to configure Reliability while communicating with WCF Services?
Reliability can be configured in the client config file by adding reliableSession under binding tag.
Reliability is supported by following bindings only:
NetTcpBinding
WSHttpBindingWSFederationHttpBinding
WSDualHttpBinding

5.) Will Windows Communication Foundation applications interoperate with Web services built with other technologi
es?
Yes. By default,services built with WCF will communicate with other services based on the interoperable Web services specifications. This means that WCF services will communicate with any application built on an infrastructure that also conforms to these standards. Microsoft is deeply committed to p
latform interoperability and is an active member of key standards organizations defining the latest Web services standards. 

6.) How to set the timeout property for the WCF Service client call?
The timeout property can be set for the WCF Service client call using binding tag. If no timeout has been specified, the default is considered as 1 minute.

7.) What are the core components of an Windows Communication Foundation service?
A host environment—an application domain and process—in which the service runs;
A service class, implemented in C# or VB.NET or another CLR-based language that implements one or more methods;
One or more endpoints that allow clients to access the service.
8.) What are different elements of WCF Srevices Client configuration file?
WCF Services client configuration file contains endpoint, address, binding and contract. 

1 comment:

RRave said...
This comment has been removed by a blog administrator.