Professional Documents
Culture Documents
70-513
Exam Name:
TS:Windows Communicaton Found Dev w/MS .NET Frmwk (C# and
VB) 4
You are creatng a Window s Communicaton Foundaton (WCF) service applicatonn The applicaton
needs to service many clients and requests simultaneouslyn The applicaton also needs to ensure
subsequent individual client requests provide a stateful conversatonn You need to confgure the
service to support these requirementsn Which atribute should you add to the class that is
implementng the service?
An [ ServiceBehavior ( InstanceContextMode =
InstanceContextModenPerSession,
ConcurrencyMode = ConcurrencyModenSingle )]
Bn [ ServiceBehavior ( InstanceContextMode =
InstanceContextModenPerCall,
ConcurrencyMode = ConcurrencyModenReentrant )]
Cn [ ServiceBehavior ( InstanceContextMode =
InstanceContextModenPerSession,
ConcurrencyMode = ConcurrencyModenMultple )]
Dn [ ServiceBehavior ( InstanceContextMode =
InstanceContextModenPerCall,
ConcurrencyMode = ConcurrencyModenMultple )]
Answer: C
Queston: 2
A service implements the following contractn (Line numbers are included for reference onlyn)
ContosoService uses NetMsmqBinding to listen for messagesn The queue was set up to use
transactons for adding and removing messagesn You need to ensure that OperatonOne and
OperatonTwo execute under the same transacton context when they are invoked in the same
sessionn What should you do?
Page | 2
[TransactonFlow(TransactonFlowOptonnMandatory)]
Bn Insert the following atribute to OperatonOne on ContosoServicen
[OperatonBehavior(TransactonScopeRequired = true,
TransactonAutoComplete = false)]
Insert the following atribute to OperatonTwo on ContosoServicen
[OperatonBehavior(TransactonScopeRequired = true,
TransactonAutoComplete = true)]
Cn Add the following XML segment to the applicaton confg fle in the systemnserviceModel/bindings
confguraton sectonn
<netMsmqBinding>
<binding name="contosoTx" durable="true" receiveContextEnabled="true" />
</netMsmqBinding>
Then use the NetMsmqBinding named contosoTx to listen for messages from the clientsn
Dn Add the following XML segment to the applicaton confg fle in the systemnserviceModel/bindings
confguraton sectonn
<customBinding>
<binding name="contosoTx">
<transactonFlow />
<binaryMessageEncoding />
<msmqTransport durable="true" />
</binding>
</customBinding>
Then use the CustomBinding named contosoTx to listen for messages from the clientsn
Answer: B
Queston: 3
A Windows Communicaton Foundaton (WCF) soluton exposes the following service over a TCP
bindingn (Line numbers are included for reference onlyn)
01 [ServiceContract]
02 [ServiceBehavior(ConcurrencyMode = ConcurrencyModenMultple)]
03 public class DataAccessService
04 {
05 [OperatonContract]
06 public void PutMessage(string message)
07 {
08 MessageDatabasenPutMessage(message);
09 }
10 [OperatonContract]
11 public string[] SearchMessages(string search)
12 {
13 return MessageDatabasenSearchMessages(search);
14 }
15 }
MessageDatabase supports a limited number of concurrent executons of its methodsn
You need to change the service to allow up to the maximum number of executons of the methods of
MessageDatabasen This should be implemented without preventng customers from connectng to
the servicen
What should you do?
Page | 3
InstanceContextMode = InstanceContextModenSingle)]
Bn Change the service behavior as followsn
[ServiceBehavior(ConcurrencyMode = ConcurrencyModenSingle,
InstanceContextMode = InstanceContextModenPerSession)]
Cn Add a throtling behavior to the service, and confgure the maxConcurrentCallsn
Dn Add a throtling behavior to the service, and confgure the maxConcurrentSessionsn
Answer: C
Queston: 4
You are developing a Windows Communicaton Foundaton (WCF) service that allows customers to
update fnancial dat
an The service contract is defned as followsn (Line numbers are included for reference onlyn)
Answer: B
Queston: 5
Page | 4
You are developing a Windows Communicaton Foundaton (WCF) service that is hosted by a
Windows Forms applicatonn
The ServiceHost instance is created in the Form constructorn
You need to ensure that the service is not blocked while the UI thread is busyn
What should you do?
An Decorate the service implementaton class with the following line of coden
[ServiceBehavior(
UseSynchronizatonContext = false)]
Bn Decorate the service implementaton class with the following line of coden
[ServiceBehavior(
ConcurrencyMode = ConcurrencyModenMultple)]
Cn Call the Invoke method of the form and supply a delegaten
Dn Call the BeginInvoke method of the form and supply a delegaten
Answer: A
Queston: 6
You develop a Windows Communicaton Foundaton (WCF) service that employees use to access
bonus informatonn You defne the following service contractn (Line numbers are included for
reference onlyn)
01 [ServiceContract(SessionMode = SessionModenRequired)]
02 public interface IFinancialService
03 {
04 [OperatonContract]
05 string Login(int employeeID, string passwordHash);
06
07 [OperatonContract]
08 double GetBonus(int month);
09
10 [OperatonContract(IsTerminatng = true)]
11 void Logout();
12 }
Client applicatons can invoke methods without logging inn
You need to ensure that the client applicatons invoke Login before invoking any other methodn
You also need to ensure that client applicatons cannot consume the service afer invoking Logoutn
Which two actons should you perform? (Each correct answer presents part of the solutonn Choose
twon)
Answer: C, D
Queston: 7
Page | 5
You develop a Windows Communicaton Foundaton (WCF) service that interacts with Microsof
Message Queuing (MSMQ)n
The service requires sessionsn You need to create a custom binding that enables messages sent to the
queue to be viewed when you are using a listener tooln
Which binding elements should you use?
Answer: A
Queston: 8
You are creatng a Windows Communicaton Foundaton (WCF) servicen The service endpoints
change frequentlyn
On the service, you add a new ServiceDiscoveryBehavior to the Behaviors collecton of the
ServiceHost Descripton propertyn
You need to ensure that client applicatons can communicate with the service and discover changes
to the service endpointsn
What should you do?
Answer: C
Queston: 9
You are developing an applicaton to update a users social statusn You need to consume the service
using Windows Communicaton Foundaton (WCF)n
The client confguraton is as followsn
<systemnserviceModel>
<bindings>
<webHtpBinding>
<binding name="SocialConfg">
<security mode="TransportCredentalOnly">
<transport clientCredentalType="Basic"
realm="Social API" />
</security>
</binding>
</webHtpBinding>
</bindings>
<client>
<endpoint address="htp://contosoncom"
binding="webHtpBinding"
bindingConfguraton="SocialConfg"
Page | 6
contract="ISocialStatus"
name="SocialClient" />
</client>
</systemnserviceModel>
The service contract is defned as followsn
[ServiceContract] public interface ISocialStatus {
[OperatonContract]
[WebInvoke(UriTemplate =
"/statuses/updatenxml?status={text}")]
void UpdateStatus(string text);
}
Which code segment should you use to update the social status?
Answer: A
Queston: 10
You are developing a client applicaton that uses the following code to consume a Windows
Page | 7
Communicaton Foundaton (WCF) servicen (Line numbers are included for reference onlyn)
01 BasicHtpBinding myBinding = new BasicHtpBinding();
02 EndpointAddress myEndpointAddress =
new EndpointAddress(
"htp://contosoncom/TaxServicensvc");
03
04 ITaxService client = channelFactorynCreateChannel();
05 string data = clientnGetData(1);
You need to consume the servicen
Which code segment should you insert at line 03?
Answer: C
Queston: 11
You are developing a client applicaton that consumes a Windows Communicaton Foundaton (WCF)
servicen
You use the svcutlnexe utlity to create a proxy for the servicen
You use the svcutlnexe switches that generate asynchronous callsn GetFlight is a service operaton
that takes no parameters and returns a stringn The GetFlightCallback method must be called when
the service operaton returnsn
You create an instance of the client proxy with the following coden
var client = new TravelServiceClient();
You need to ensure that a callback is received when the GetFlight operaton is called asynchronouslyn
Which code segment should you use?
An clientnBeginGetFlight(GetFlightCallback, null);
clientnGetFlight();
Bn clientnGetFlight();
clientnBeginGetFlight(GetFlightCallback, null);
Cn clientnGetFlightCompleted +=
new EventHandler<GetFlightCompletedEventArgs>(
GetFlightCallback);
clientnGetFlightAsync();
Dn IAsyncResult asyncResult = clientnBeginGetFlight(
GetFlightCallback, client);
clientnEndGetFlight(asyncResult);
Answer: C
Queston: 12
A Windows Communicaton Foundaton (WCF) soluton uses the following contractsn (Line numbers
are included for reference onlyn)
01 [ServiceContract(CallbackContract = typeof(INameService))]
Page | 8
02 public interface IGreetngService
03 {
04 [OperatonContract]
05 string GetMessage();
06 }
07
08 [ServiceContract]
09 public interface INameService
10 {
11 [OperatonContract]
12 string GetName();
13 }
When the client calls GetMessage on the service interface, the service calls GetName on the client
callbackn In the client, the class NameService implements the callback contractn
The client channel is created as followsn
22 In stanceContext callbackContext =
new InstanceContext(new NameService("client"));
25 DuplexChannelFactory<IGreetngService> factory =
new DuplexChannelFactory<IGreetngService>(
typeof(NameService), binding, address);
26 IGreetngService greetngService = factorynCreateChannel();
You need to ensure that the service callback is processed by the instance of NameServicen
What are two possible ways to achieve this goal? (Each correct answer presents a complete solutonn
Choose twon)
Answer: A, B
Queston: 13
A Windows Communicaton Foundaton (WCF) service has a callback contractn You are developing a
client applicaton that will call this servicen
You must ensure that the client applicaton can interact with the WCF servicen
What should you do?
Answer: C
Page | 9
Queston: 14
An ConsolenWriteLine(itemnContentnType);
ConsolenWriteLine(((TextSyndicatonContent)itemnContent)nText);
Bn ConsolenWriteLine(itemnContentnGetType());
ConsolenWriteLine(((TextSyndicatonContent)itemnContent)nText);
Cn ConsolenWriteLine(itemnContentnType); ConsolenWriteLine(itemnContentnToString());
Dn ConsolenWriteLine(itemnContentnGetType()); ConsolenWriteLine(itemnContentnToString());
Answer: A
Queston: 15
An tcpTransport
windowsStreamSecurity
transactonFlow
binaryMessageEncoding
Bn transactonFlow
binaryMessageEncoding
windowsStreamSecurity
tcpTransport
Cn windowsStreamSecurity
tcpTransport
binaryMessageEncoding
transactonFlow
Dn binaryMessageEncoding
transactonFlow
tcpTransport
windowsStreamSecurity
Answer: B
Page | 10
Thank You for trying 70-513 PDF Demo
https://www.certificationsdesk.com/Microsoft/real-70-513-exam-questions.html
Page | 11