Microsoft
70-513 · Question #310
70-513 Question #310: Real Exam Question with Answer & Explanation
Sign in or unlock 70-513 to reveal the answer and full explanation for question #310. The question stem and answer options stay visible for context.
Question
A Windows Communication Foundation (WCF) solution uses the following contract to share a message across its clients (Line numbers are included for reference only) 01 <ServiceContract0> 02 PuElic Interface ITeamMessageService 04 <OperationContractO> 05 Function GetMessage() As String 07 <OperationContract0> 08 Sub PutMessage(Byval message As String) O9 End Interface The code for the serAce class is as follows. 10 Public Class TeamMessageService0 11 Implements lTearmt4essageService 13 Dim key As Guid = Guid.NewGuid() 14 Dim message As String = "Today's Message' 16 PuUic Function GetMessage0As String - 17 lmpements lTearm*AessageServiceGetMessage 19 Retun String. Fommat("Message:{0) Key:{ 1}", message, key) 20 End Function 22 PubIic Sub PutMessage(ByV message As Stnng) - 23 lmpements lTearrlessageService PutMessage 25 Me message = message 26 End Sub 28 End Class The service is self-hosted The hosting code rs as follows 29 Dim host As ServiceHost = New ServiceHost(GetType(TearrwiessageSeMce))? 30 Dim binding As Basic HttpBindngt New BasicHttpBindiig(BasicHttpSecurityMode. None) 31 host.AddServiceEndpoint( "MyAppication lTearrtAessageService", binding Thttp /Ilac aihost. 1 2345) 32 host Open() You need to ensure that all clients calling GetMessage will retrieve the same string, even if the message is upd(ed by clients calling PutMessage what should you do?
Options
- AAdd the following attribute to the TeamMessageService class, before line 10.
- BAdd the following attribute to the TeamMessageService class, before line 10002E
- CPass a service instance to the instancing code in line 29, as follows.
- DRedefine the message string in line 14, as follows.
Unlock 70-513 to see the answer
You've previewed enough free 70-513 questions. Unlock 70-513 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.