70-513 · Question #316
A Windows Communication Foundation (WCF) client and service share the following service contract interface. [ServiceContract] public interface IContosoService { [OperationContract] void…
The correct answer is D. Add the following attribute to the SavePerson operation on lContosoService. See the full explanation below for the reasoning.
Question
A Windows Communication Foundation (WCF) client and service share the following service contract interface. [ServiceContract] public interface IContosoService { [OperationContract] void SavePerson(Person person); } They also use the following binding. NetTcpBinding binding new NetTcpBinding { TransactionFlow = true }; The client calls the service with the following code using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { IContosoService client = factoryCreateChannelO; client SavePerson(person); ConsoleWriteLine( TransactionCurrentTransactionlnformation. Distributedldentifier); tsCompleteO; } The service has the following implementation for SavePerson public void IContosoService SavePerson(Person person) { person.Saveo; ConsoleWriteLine(TransactionCurrentTransactionlnformation. Distributedidentifier); } The distributed identifiers do not match on the client and the server You need to ensure that the client and server enlist in the same distributed transaction What should you do?
Options
- AAdd the following attributes to the SavePerson operation on IContosoService.
- BAdd the following attributes to the SavePerson operation on lContosoService
- CAdd the following attribute to the SavePerson operation on lContosoService
- DAdd the following attribute to the SavePerson operation on lContosoService
How the community answered
(24 responses)- A8% (2)
- B4% (1)
- C4% (1)
- D83% (20)
Community Discussion
No community discussion yet for this question.