wcf interview questions and answers - skillgun
What is a service contract ?
Service contract is an attribute when it is applied on top of a class or interface , the corresponding class is exposed to the clients .
Service Contract is a group of messages .
service contract is a group of data members which are exposed to the
clients as data members .
None of the above.
When a service contract class is applied on top of a class or interface the corresponding class or interface is exposed to the client as a class .
What is an operation contract ?
an operation contract is an attribute when it is applied on top of any operation or method , the corresponding method is exposed ( visible ) to the clients .
an operation contract is an attribute when it is applied on any method or operation that operation must return serialised data back to client from wcf service .
an operation contract used for returning faults back to the callers .
What is a data contract ?
data contract is an attribute which must be applied to return a complex serialized type to exchange data between wcf service and client .
data contract attribute must be applied on top of methods to expose methods to the clients .
data contract attribute must be applied on an interface to make a class serilazable which is implementing the interface .
data contract must be used to serialize an object of class for transporting object data from wcf service to wcf client and back to wcf service from a client .
what is wcf and what is the use of wcf ?
Wcf stands for windows common foundation , and is a distributed technology which replaces webservices.
wcf stands for windows communication foundation, wcf acts as a unified model for all the microsoft distributed technologies .
wcf is a distributed technology which replaces dcom RMI .
wcf is a distributed technology which can replace the use of multiple microsoft distributed technologies .
How to consume a wcf service from client application ( choose most relevant step by step procedure ) ?
1.Create a proxy class of wcf service in client machine and create a proxy class of wcf client in server where wcf service is running and start communicating using both the proxies .
1.Create wcf proxy in client application .
2.Define end point in client as well as wcf service application .
1.Create wcf service proxy in client application .
2.Define end point in client application .
3.Create object of a proxy class from client application and call proxy methods .
All the above options are correct .
types of hosting in wcf (identify one or more options available for hosting a wcf service ) ?
iis hosting .
windows activation service hosting .
self hosting and windows service hosting .
wcf service can be hosted in different ways ( iis , was , windows service and self hosting ) .
How to overload a method in wcf ?
there is no way to overload a method which is marked with operation contract attribute in wcf .
no extra mechanism required for overloading a method , it is same as c# overloading .
same as C# overloading but we need to assign a value to the name parameter in the operation contract attribute .
no explanation available .
what is binding in wcf ?
binding contains the information about how to communicate to the wcf service from wcf client .
binding can contain protocol , message exchange mechanism like xml/json/text/mtom and security features .
binding contains the information about how to exchange data between two end points .
which is the default binding in wcf ?
which of the following file is required for creating a proxy in wcf ?
what is the use of DataMember attribute in wcf ?
data member attribute makes a data member or a variables data serializable .
data member attribute makes a method visble to the client applications.
data member attributes makes a class visible to the client applications .
data contract and data member attributes make a class and and the data members of a class serializable . From .NET F/W 3.5 sp1 or later versions microsoft made all the classes and all public members as serializable by default . Hence from F/W 3.5 sp1 it is not mandatory to apply DataContract and DataMember to make a class or variable as serializable.
What is an end point in wcf ?
An end point is a combination of address , binding and contract .
an end point is required for the wcf client to identify the location of wcf service .
an endpoint is used by the wcf service to locate wcf client .
Option 1 and 2 are correct .
end point is required for wcf service and not for client application .
what is abc of wcf ?
abc stands for address binding and contract .Address refers to the address of wcf client and binding refers to the communication mechanism between wcf client and wcf service .
abc stands for address binding and contract . Address refers to the location where wcf service is existing and binding contains information about how to communicate to the wcf service . Contract usually refers to the service contract with which client has to communicate .
abc refers to address binding and contract . ABC can be collectively called as end point .
option 2 and 3 are correct .
what is wsdl and what is the use of wsdl in wcf ?
wsdl stands for web services description language . Wsdl is used for creating proxy classes in wcf .
wsdl stands for web services description language . Wsdl used for exchaning data between wcf client and wcf service .
wsdl is a protocol used for communication between client and service ( wsdl is used in webservices as well as wcf ) .
wsdl is used for creating proxy class. When you pass wsdl to svcutil tool it can able to generate proxy class and end point information . Wsdl contains all the classes ( service contracts ) and all the methods ( oeration contract methods ) .
In which name space ServiceContractAttribute class is present in wcf ?
Which wcf binding will not allow transaction ?
what is a request reply contract ?
A request reply service is an operation contract for which a client makes a call to operation and client has to wait till getting reply from service .
A request reply service is an operation contract which is used only for asynchronous communication ( when an async request is sent the service will send async response or reply ) .
A request reply service is an operation contract which for which a client makes a synchronous request and service will respond with an asynchronous reply .
None of the above .
Default Operation contract type in wcf is a Request reply type .
what is a one way contract in wcf ?
An operation contract which is having return type as void is called as one way contract .
One way contract is an operation contract which can be called by a client and client will not expect any reply .
Both the definitions are correct .
For defining a one way contract , the corresponding methods return type must be void and we must pass IsOneWay parameter to operationcontract attribute by assigning true to IsOneWay parameter .
what is a duplex contract in wcf ?
a duplex contract in wcf is a type of request reply operation contract .
a duplex contract is a type of service contract which enables both client and service can send messages independently to the others .
a duplex contract is a service contract which works only when client supplies callback contract .
options 2 and 3 are correct .
which wcf binding will not support security ?
BasicHttpBinding will not support security .
Back To Top