WCF interview Questions–part 4
This WCF service tutorial are part-4 in series of WCF interview Questions. Before reading this please go through the following articles in this series.
This is the fourth part of the WCF question and answer tutorial, please read the article listed below before reading.
- WCF Service Interview Questions–part 1
- WCF Service Interview Questions–part 2
- WCF Service Interview Questions–part 3
WCF interview Questions List–part 4
- What are SOA (Service oriented Architecture) and how WCF supports it? "What is SOA (service-oriented architecture) and how does WCF support it?" "
- What is an ESB in SOA environment? "What is an ESB in an SOA environment"
- What is Transaction propagation? And how is WCF support it? "What is transactional propagation and how does WCF support it?" "
- Does all WCF bindings support for Transaction propagation? "is not all WCF bindings supported for transactional propagation?" "
- What is the various Transaction Flow Options available in WCF? "What are the various transaction flow options available in WCF?"
- What is two-phase committed protocol? "What is the two-phase submission agreement?" "
- What's the role of transaction manager in WCF? "What is the role of the transaction manager in WCF?"
- What is the supported transaction types in WCF? "What transaction types does WCF support?" "
- How to enable the performance Counters in WCF? "How do I enable performance counters for WCF?"
What's SOA (Service oriented Architecture) and how does WCF supports it? "What are SOA (Services Oriented architecture) and how does WCF support it?" "
SOA is basically an architectural model, dictates few principles for building business applications in the form of IND Ependent, loosely coupled and interoperable services. These services is well defined, self-contained and can work together to achieve certain business functionality without de Pending on the context or state of the other services.
SOA is an architectural model that prescribes a number of principles for creating form-independent, loosely-coupled, interoperable business applications. These definitions are very good, independent services that can work with each other to achieve some kind of business function without the need to rely on context, or the state of other services.
WCF supports almost all those principles dictated by Service oriented Architecture for developing services; those is Independent, loosely coupled and interoperable also. Visit for detailed discussion on WCF and SOA.
WCF supports almost all the principles of service-oriented architecture for developing services. They are independent, loosely coupled, and equally interoperable, for more detailed discussion, see WCF and SOA.
What is an ESB in SOA environment? "An ESB in an SOA environment "
In Service oriented Architecture environment, ESB (Enterprise Service Bus) acts as a single interface for all messaging be Tween applications and services in a loosely coupled manner. ESB is capable to call and subscribe different service provider ' s methods and subscriptions respectively.
In an environment of service-oriented architecture, an ESB (Enterprise service Bus) acts as an interface for all message passing between applications and services in a loosely coupled manner. The ESB can invoke and differentiate the methods of different service providers.
What is Transaction propagation? And how does WCF support it? "What is transactional propagation, and how is WCF supporting it?" "
Transaction propagation is the ability to propagate Transaction across the boundaries of a single service. Or in the other words, we can say the a service can participate in a transaction that's initiated by a client.
In a SOA environment, transaction propagation becomes a key requirement. As we know that WCF-supports SOA, so it provides support for transaction propagation as well.
Transactional communication is the ability to propagate transactions between the boundaries of a single service. Or, in other words, a service can be added to a client-initiated transaction. In an SOA environment, transactional propagation becomes a critical imperative. We know that WCF supports SOA, so WCF also supports transactional propagation.
to enable transaction propagation, we need to set the value of TransactionFlow property of the binding being used. This can is done programmatically as follows:
In order to start the transaction propagation, we need to set the value of the TransactionFlow property that is bound, here is the specific practice:
wshttpbinding bindingbeingused = new Wshttpbinding ();
Bindingbeingused.transactionflow = "true";
Or It can be do declaratively by updating configuration file as follows:
Or you can enable transaction propagation by modifying the configuration file, for example:
<bindings>
<wsHttpBinding>
<binding name= "Binding1"
Transactionflow= "true"/>
</wsHttpBinding>
</bindings>
Default value for TransactionFlow property is "False". "The default TransactionFlow property value is False"
Does All WCF bindings supports for Transaction propagation? "is not all WCF bindings supported for transactional propagation? "
No. Not all WCF bindings support transaction propagation. Only following list of bindings support for it.
No, not all WCF bindings support transactional propagation, only the bindings listed below support transactional propagation.
- Wshttpbinding
- NetTcpBinding
- NetNamedPipeBinding
- Wsdualhttpbinding
- WSFederationHttpBinding
What is the various Transaction flow options available in WCF? "How are the various transaction flow choices available in WCF?"
If A service is configured for Transaction propagation, WCF further supports various options for service methods to be par T of any transaction initiated outside service boundaries.
If transaction propagation is configured for the service, WCF will further support various methods of service beyond the service boundary.
- notallowed Transaction propagation is not a allowed for particular service method. Its default value.
notallowed is not allowed to be applied to a particular service method, which is the default value.
- allowed Transaction propagation is allowed and not compulsory.
allowed , allowed, but not mandatory.
- Mandatory Transaction propagation is compulsory for that service method.
Mandatory Mandatory, mandatory for service methods
For example, Transaction propagation are mandatory for Creditaccount service method in following code snippet.
For example, the option to set a transaction for the Creditaccount service method is mandatory in the following code fragment.
[ServiceContract]
Interface Ipaymentservice
{
[OperationContract]
[TransactionFlow (Transactionflowoption.mandatory)]
void Creditaccount (...);
}
What's two-phase committed protocol? "What's the two-phase submission agreement? "
In a distributed transaction scenario, two-phase committed protocol are an algorithm that ensures all the participating pro Cesses in a distributed transaction is ready for being committed or roll backed.
In a distributed scenario, the two-phase committed protocol is an algorithm that ensures that all processes participate in a distributed commit or rollback.
This is do in both phases:
- Prepare Phase
- Commit phase
What's the role of transaction manager in WCF? "WCF, what does the transaction manager do?"
Transaction Manager while sitting in client side, initiate the Transaction and coordinates with all the processes that par Ticipate in a distributed transaction to commits or roll back.
Transaction management is set up on the client side, it is responsible for initiating transactions, and coordinating all processes involved in the distribution, either committed or rolled back.
What is the supported transaction types in WCF? "which transaction types does WCF support?" "
supported transaction types in WCF is: "The types of transactions supported by WCF are:"
- Light Weight "Lightweight"
- OLE Transactions "OLE Transaction"
- ws-atomic Transactions "Ws-atomic Transaction"
How to enable the performance Counters in WCF? "How do I turn on WCF performance counters?"
Simple-to-enable performance Counters supported by WCF-is as follows:
A simple way to start the WCF performance counters is as follows:
<system.serviceModel>
<diagnostics performancecounters = "All"/>
</system.serviceModel>
Above configuration setting would enable all categories of counters including Servicemodelservice, Servicemodelendpoint and Servicemodeloperation. Default value for it is "OFF".
the above settings will start all kinds of counters, including: Servicemodelservice, Servicemodelendpoint and Servicemodeloperation, by default its value is off.
WCF Learning Series four--"WCF interview Questions–part 4 translation series"