70-513 40 Q&S Win Communication Foundation Development with Microsoft .NET Framework 4 C# &VB

Which two configuration settings should you add?

You are creating an ASP .NET web application that hosts several Windows Communication Foundation (WCF) services. The services have ASP.NET Compatibility Mode enabled.
Users authenticate with the Web application by using a cookie-based ASP.NET Forms Authentication model.
You add a service tile named Authentication.svc that contains the following code segment

You need to ensure that users can access the WCF services without having to re-authenticate. Which two configuration settings should you add? (Each is part of a complete solution. Choose two.)
A. In the system web. Extensions scripting/web Services/authentication Service element, set the enabled attribute to true.
B. In the system web. Extensions scripting/web Services/profile Service element, set the enabled attribute to true.
C. Add a service endpoint with basicHttpBinding for the contract System.Web.ApplicationServices.Authentication Service.
D. Add a custom service behavior named Authentication Service Type Behaviors with a service AuthenticationManager element that has service AuthenticationManagerType set to System.Web.Security.SQL Membership Provider


Answer Clike
Which XML segment should you add to the system.serviceModel configuration section of the web.config file?

Four Windows Communication Foundation (WCF) services are hosted in Microsoft Internet Information Services (IIS). No behavior configuration exists in the web.config fiIe.
You need to configure the application so that every service and endpoint limits the number of concurrent calls to 50 and the number of concurrent sessions to 25.
Which XML segment should you add to the system.serviceModel configuration section of the web.config file?
A.

B.

C.

D.



Answer Clike
Which binding should you use?

You are creating a windows Communication Foundation (WCF) service. You need to ensure that the service is compatible wfth ASP .NET to make use of the session state. Which binding should you use?
A. NetTcpContextBinding
B. BasicHttpContextBinding
C. NetTcpBinding
D. NetMsmqBinding


Answer Clike
What should you do?

You are creating a Windows Communication Foundation (WCF) service based on WSHttpBinding. New audit requirements dictate that callers must be authenticated on every call to ensure that their credentials have not been revoked.
You need to ensure that the service will not cache the security request token.
What should you do?
A. Apply a ServiceBehavior attribute to the service implementation class with the lnstanceContextMode property set to Single.
B. In the message security configuration, change clientCredentialType from lssuedToken to UserName
C. In the message security configuration, set establishSecurityContext to false.
D. At the end of every operation, call the SessionStateUtility.RaiseSessionEnd method.


Answer Clike
What should you do?

You have an existing Windows Communication Foundation (WCF) service. You need to ensure that other services are notified when the service is started.
What should you do?
A. Add the following standard endpoint to the service <endpoint names"udpAnnouncementEndpoint" kind="udpDiscoveryEndpoint" />
B. Add the following standard endpoint to the service
<endpoint name="udpDiscoveryEndpoint kind="udpAnnouncementEndpoint" />
C. Add a service behavior with the following element.

D. Add a service behavior with the following element.



Answer Clike
Which two actions should you perform?

You are developing a Windows Communication Foundation (WCF) service. You write a method named Submit that accepts messages of the type System.ServiceModel.Channels.Message. You need to process the body of the incoming messages multiple times in the method. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Use the GetBody method of the Message class to read the content of the messages.
B. Use the CreateBufferedCopy method of the Message class to load the messages into memory.
C. Use the WriteBodyContents method of the BodyWriter class to make a copy of the messages.
D. Use the CreateMessage method of the MessageBuffer class to make a copy of the messages.


Answer Clike
What should you do?

Your Windows Communication Foundation (WCF) client application uses HTTP to communicate with the service.
You need to enable message logging and include all security information such as tokens and nonces in logged messages. What should you do?
A. In the application configuration file, add the IogKnownPii attribute to the message logging diagnostics source and set the value of the attribute to true.
Generate the ContosoService class using the Add Service Reference wizard.
Add a reference to System.ServiceModel. Routing.dll.
Add the following code segment.
ContosoService client = new ContosoService();
SoapProcessingBehavior behavior = new SoapProcessingBehavior0;
behavior.ProcessMessages = true;
client.Endpoint.Behaviors.Add(behavior);
B. In the application configuration file, add the following XML segment to the system.serviceModel configuration section group.

C. In the machine configuration file, add the following XML segment to the system.serviceModel configuration section.
<machineSettings enableLoggingKnownPii="true" />
Generate the ContosoService class using the Add Service Reference wizard. Add the following code segment.
ContosoService client = new ContosoService();
client.Endpoint.Behaviors.Add(new CallbackDebugBehavior(true));
D. In the machine configuration file, add the following XML segment to the system.serviceModel configuration section.
<machineSettings enableLoggingKnownPii="true" />
In the application configuration file, add the IogKnownPii attribute to the message logging diagnostics source and set the value of the attribute to true. In the application configuration file, add the following XML segment to the system.serviceModel configuration section group.



Answer Clike
What should you do?

You are integrating a Windows Communication Foundation (WCF) service within an enterprise-wide Service Oriented Architecture (SOA) Your service has the following service contract.

You need to allow the code in the ConfirmCreditCard method to participate automatically in existing transactions. If there is no existing transaction, a new transaction must be created automatically. What should you do?
A. Inside the ConfirmCreditCard method, surround the code that must participate in the transaction with a using(new TransactionScope()) block
B. Inside the ConfirmCreditCard method, surround the code that must participate in the transaction with a using(new CommittableTransaction()) block.
C. Add an [OperationBehavior(TransactionScopeRequired=true)] attribute to the ConfirmCreditCard method.
D. Add an [OperationBehavior(TransactionAutoComplete=true)] attribute to the ConfirmCreditCard method.


Answer Clike
Which attribute should you add to the class that is implementing the service?

You are creating a Window Commnunication Foundation (WCF) service application. The application needs to service many clients and requests simultaneously. The application also needs to ensure subsequent individual client requests provide a stateful conversation. You need to configure the service to support these requirements. Which attribute should you add to the class that is implementing the service?
A. [ServiceBehavior(lnstanceContextMode = lnstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Single)]
B. [ServiceBehavior(lnstanceContextMode = lnstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode. Reentrant)]
C. [ServiceBehavior(InstanceContextMode = lnstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)]
D. [ServiceBehavior(lnstanceContextMode = lnstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) service has the following contract:

The service and the clients that call the service use NetTcpBinding with transaction flow enabled. You need to configure the service so that when TxOp1 and TxOp2 are invoked under the same client session, they run under the same transaction context. What should you do?
A. Update the service contract to read as follows.
[ServiceContract(SessionMode=SessionMode.Required)]
Add the following behavior to the service implementation
[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession)]
B. Update the service contract to read as follows.
[ServiceContract(SessionMode=SessionMode.Allowed)]
Add the following behavior to the service implementation.
[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single,
ReleaseServiceInstanceOnTransactionComplete=false)]
C. Update the service contract to read as follows
[ServiceContract(SessionMode=SessionMode.Allowed)]
Add the followng behavior to the service implementation.
[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
D. Update the service contract to read as follows.
[ServiceContract(SessionMode=SessionMode.Required)]
Add the following behavior to the service implementation.
[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)]


Answer Clike
What are two possble ways to achieve this goal?

A WCF service code is implemented as follows. (Line numbers are included for reference only)

You need to increase the rate by which clients get the required response from the service. What are two possble ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Change the service behavior to the following:
[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single, ConcurrencyMode=ConcurrencyMode.Multiple)]
B. Change the service behavior to the following.
[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)]
C. Require the clients use threads, the Parallel Task Library, or other mechanism to issue service calls in parallel.
D. Require the clients to use async operations when calling the senvice.


Answer Clike
What should you do?

A service implemerts the following contract. (Line numbers are included for reference only)

The service is implemented as follows.

ContosoService uses NetMsmqBinding to listen for messages. The queue was set up to use transactions for adding and removing messages.
You need to ensure that OperationOne and OperationTwo execute under the same transaction context when they are invoked in the same session. What should you do?
A. Insert the following attribute to OperationOne on lContosoService
[TransactionFlow(TransactionFlowOption.Mandatory)]
Insert the following attribute to OperationTwo on IContosoService
[TransactionFlow(TransactionFlowOption.Mandatory)]
B. Insert the following attribute to OperationOne on ContosoSeivice
[OperationBehavior(TransactonScopeRequired=true, TransactionAutoComplete=false)]
Insert the following attribute to OperationTwo on ContosoService.
[OperationBehavior(TransactionScopeRequired=true, TransactionAutoComplete=true)]
C. Add the following XML segment to the application config file in the system serviceModel/bindings configuration section

Then use the NetMsmqBinding named contosoTx to listen for messages from the clients
D. Add the following XML segment to the application config file in the systemserviceModel/bindings configuration section.

Then use the CustommiBinding named contosoTx to listen fcw messages from the clierts.


Answer Clike
Which two actions should you perform?

A Windows Communication Foundation (WCF) solution uses the followng contract

You need to change this interface so that:
lnitialize is allowed to be called at any time before Terminate is called. DoSomething is allowed to be called only after Initialize is called, and not allowed to be called after Terminate is called. Terminate will be allowed to be called only after Initalize is called Which two actions should you perform?
(Each correct answer presents part of the sdution. Choose two)
A. Change the ServiceContract attribute of the IMyService interface to the following.
[ServiceContract(SessionMode=SessionMode.Required)]
B. Change the ServiceContract attrbute of the IMyService interface to the following
[ServiceContract(SessionMode=SessionMode.Allowed)]
C. Change the OperationContract attribute of the Initialize operation to the following.
[OperationContract(IsInitiating = true, IsTerminating = false)]
D. Change the OperationContract attribute of the Terminate operation to the following
[OperationContract(IsInitiating = false, IsTerminating = true)]


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) client and service share the following service contract interface

They also use the following binding.
NetTcpBinding binding = new NetTcpBinding { TransactionFlow = true };
The client calls the service with the following code

The service has the following implementation for SavePerson

The distributed identifiers do not match on the client and the serve.r You need to ensure that the client and server enlist in the same distributed transaction. What should you do?
A. Add the following attributes to the SavePerson operation on IContosoService.
[OperationBehavior(TransactionScope.Required = true)]
[TransactionFlow(TransactionFlowOption.Mandatory)]
B. Add the following attributes to the SavePerson operation on lContosoService
[TransactionFlow(TransactionFlowOption.Mandatory)]
[OperationBehavior(TransactionScope.Required = true)]
C. Add the following attribute to the SavePerson operation on lContosoService
[TransactionFlow(TransactionFlowOption.Mandatory)]
[OperationBehavior(TransactionScope.Required = true)]
D. Add the following attribute to the SavePerson operation on lContosoService
[TransactionFlow(TransactionFlowOption.Allowed)]
Add the following attribute to the implementation of SavePerson.
[OperationBehavior(TransactionScope.Required = true)]


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) solution provides a session-based counter. The service is self-hosted. The hosting code is as follows:

This service is currently exposed over TCP, but needs to be exposed to external clients over HTTP. Therefore, a new service endpoint is created with the following code.
host.AddServiceEndpoint("MyApplication.ICounterService", binding2, "http://localhost:12345");
You need to complete the implementation and ensure that the session-based counter will perform over HTTP as it does over TCP. What should you do?
A. Define binding2 as follows
WS2007HttpBinding binding2 = new WS2007HttpBinding(SecurityMode.None);
Configure binding2 as follows
binding2.ReliableSession.Enabled = true;
B. Define binding2 as follows
WSHttpBinding binding2 = new WSHttpBinding(SecurityMode.None);
Add the following behavior to the service implementation
ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
C. Define binding2 as follows.
BasicHttpBinding binding2 = new BasicHttpBinding(BasicHttpSecurityMode.None);
Enable cookies for binding2.
binding2.AllowCookies = true:
D. Define binding2 as follows
BasicHttpBinding binding2 = new BasicHttpBinding(Basic HttpSecurityMode.None)
Add the following behavior to the service implementation.
[ServiceBehavior(InstanceContexMode = InstanceContextMode.Single)]


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) solution exposes the following service over a TCP binding (Line numbers are included for reference only.)

MessageDatabase supports a limited number of concurrent executions of its methods. You need to change the service to allow up to the maximum number of executions of the methods of MessageDatabase. This should be implemented without preventing customers from connecting to the service. What should you do?
A. Change the service behavior as follows.
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)]
B. Change the service behavior as follows.
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerSession)]
C. Add a throttling behavior to the service, and configure the maxConcurrentCalls.
D. udd a throttling behavior to the service, and configure the maxConcurrentSessions.


Answer Clike
What should you do

A Windows Communication Foundation (WCF) solution uses the following contract to share a message across its clients. (Line numbers are included for reference only.)

The code for the service class is as follows

The service is self-hosted. The hosting code is as follows.

You need to ensure that all clients calling GetMessage will retrieve the same string, even if the message is updated by clients calling PutMessage What should you do
A. Add the following attribute to the TeamMessageService class, before line 10.
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
B. Add the following attribute to the TeamMessageService class, before line 10.
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
Then change the binding definition on the service at line 25, and on the client to the following WSHttpBinding binding new WSHttpBinding (SecurityModeNone);
binding ReliableSession.Enabled = true;
C. Pass a service instance to the instancing code in line 24, as follows.
ServiceHost host = new ServiceHost(new TeamMessageService());
D. Redefine the message string in line 13, as follows
static string message = "Today’s Message":
Then change the implementation of PutMessage in lines 19-22 to the following
public void PutMessage(string message) { TeamMessageServiceMessage.PutMessage }


Answer Clike
What should you do?

You have a secured Windows Communication Foundation (WCF) service. You need to track unsuccessful attempts to access the service. What should you do?
A. Set the authorizationManagerType attribute of the serviceAuthorization behavior to Message.
B. Set the includeExceptionDetailslnFaults attribute of the serviceDebug behavior to true.
C. Set the Mode attribute of the security configuration element to Message.
D. Set the messageAuthenticationAuditLevel attribute of the serviceSecurityAudit behavior to Failure.


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) service that handles corporate accounting must be changed to comply with govemnment regulations of auditing and accountability You need to configure the WCF service to execute under the Windows logged-on identity of the calling application.
What should you do?
A. Within the service configuration, add a ServiceAuthorization behavior to the service, and set ImpersonateCallerForAllOperations to true.
B. Within the service configuration, add a ServiceAuthenticationManager behavior to the service, and set ServiceAuthenticationManagerType to Impersonate.
C. Within the service configuration, add a serviceSecurityAudit behavior to the service, and set serviceAuthorizationAuditLevel to SuccessOrFailure
D. Within the service configuration, add a ServiceCredentials behavior to the service, and set type to Impersonate


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) service exposes two operations: OpA and OpB OpA needs to execute under the client’s identity, and OpB needs to execute under the service’s identity. You need to configure the service to run the operations under the correct identity. What should you do?
A. Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to true.
Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOption.Required
Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.Allowed.
B. Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to true.
Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOption.Allowed
Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.NotAllowed
C. Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to false.
Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOption.Allowed.
Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.NotAllowed
D. Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to false.
Apply an OperationBehavior attribute to OpA and set the Impersonation property to lmpersonationOption.Required.
Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.Allowed.


Answer Clike
What should you do?

You are developing a Windows Communication Foundation (WCF) service. The service needs to access out-of-process resources You need to ensure that the service accesses these resources on behalf of the onginating caller. What should you do?
A. Set the value of ServiceSecurityContext.Current.WindowsIdentity.ImpersonationLevel to TokenlmpersonationLevel.Impersonation
B. Set the value of ServiceSecurityContext.Current.Windowsldentity.ImpersonationLevel to TokenlmpersonationLevel.Delegation
C. Set the PrincipalPermissionAttribute on the service contract and update the binding attribute in the endpoint element of the configuration file to wsHttpBinding
D. Set the PnncipalPermissionAttribute on the service contract and update the bindingConfiguration attribute in the endpoint element of the configuration file to wsHttpBinding


Answer Clike
What should you do?

You are creating a Windows Communication Foundation (WCF) service that implements the following service contract.

You need to ensure that only users with the Manager role can call the ApproveOrder method What should you do?
A. In the method body, check the Rights PosessesProperty property to see if it contains Manager
B. Add a PrincipalPermission attribute to the method and set the Roles property to Manager
C. Add a SecurityPermission attribute to the method and set the SecurityAction to Demand
D. In the method body, create a new instance of WindowsClaimSet.
Use the FindClaims method to locate a claimType named Roee with a right named Manager


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) client uses the following service contract. (Line numbers are included for reference only.)

You need to ensure that all calls to Operation1 and Operation2 from the client are encrypted and signed What should you do?
A. Set the ProtectionLevel property in line 01 to EncryptAndSign.
B. Set the ProtectionLevel property in line 04 and line 06 to Sign.
C. Add a SecurityCriticalAttribute ror each operation.
D. Add a SecunitySafeCriticalAttribute for each operation.


Answer Clike
What should you do?

You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients when they are started The message is defined as follows

You have the following requirements:
-The CodeName property must be sent in clear text.
-The service must be able to verify that the property value was not changed after being sent by the client.
-The SecretHandshake property must not be sent in clear text and must be readable by the service.
What should you do?
A. Add a MessageBodyMember attribute to the CodeName property and set the ProtectionLevel to Sign.
Add a MessageBodyMember attribute to the SecretHandshake property and set the ProtectionLevel to EncryptAndSign.
B. Add a DataProtectionPermission attribute to the each property and set the ProtectData property to true
C. Add an xmlText attribute to the CodeName property and set the DataType property to Signed.
Add a PasswordPropertyText attribute to the SecretHandshake property and set its value to true.
D. Add an ImmutableObject attribute to the CodeName property and set its value property to true.
Add a Browsable attribute to the SecretHandshake property and set its value to false.


Answer Clike
Which behavior should you configure and apply to the service?

A Windows Communication Foundation (WCF) service interacts with the database of a workflow engine. Data access authorization is managed by the database, which raises security exceptions if a user is unauthorized to access it.
You need to ensure that the application transmits the exceptions raised by the database to the client that is calling the service. Which behavior should you configure and apply to the service?
A. routing
B. serviceDebug
C. serviceSecurityAudit
D. workflowUnhandledException


Answer Clike
Which two lines of code should ou insert between lines 02 and 03?

A Windows Communication Foundation (WCF) client application is consuming an RSS syndication feed from a blog. You have a SyndicaionFeed variable named feed. The application iterates through the items as follows.
(Line numbers are included for reference only.)

You need to display the content type and body of every syndication item to the console Which two lines of code should ou insert between lines 02 and 03?
A. ConsoleWriteLine(item.Content.Type);
ConsoleWriteLine(((TextSyndicationContent)item.Content).Text);
B. Console.WriteLine(item.Content.GetType());
Console.WriteLine(((TextSyndicationContent)item.Content).Text);
C. Console.WriteLine(item.Content.Type);
Console.WriteLine(item.Content.ToString());
D. Console.WriteLine(item.Content.GetType());
Console.WriteLine(item.Content.ToString());


Answer Clike
What should you do?

You are creating a windows Communication Foundation (WCF) service to process orders.
The data contract for the order is defined as follows

You have the following requirements
-Enable the transmission of the contents of Order from the clients to the service.
-Ensure that the contents of CreditCardNumber are not sent across the network in clear text.
-Ensure that the contents of CreditCardNumber are accessible by the service to process the order.
You need to implement the service to meet these requirements. What should you do?
A. Add a DataProtectionPermission attribute to the CreditCardNumber property and set the ProtectData property to true.
B. Convert the DataContract to a MessageContract and set the ProtectionLevel property to SignAndEncrypt
C. Change the data type of CreditCardNumber from string to SecureString
D. Implement the CreditCardNumber property getter and setter In the setter, run the value of the CreditCardNumber through the MD5CryptoServiceProvider class TransformBlock method


Answer Clike
Which code segment should you use?

You are consuming a Windows Communication Foundation (WCF) service. The service interface is defined as follows:

The client application receives a WebResponse named response with the response from the service. You need to deserialize this response into a strongly typed object representing the return value of the method.
Which code segment should you use?
A.

B.

C.

D.



Answer Clike
What should you do?

A Windows Communication Foundation (WCF) application exposes a service as a SOAP end point for consumption by cross-platform clients. During integration testing, you find that one of the clients is not generating the correct messages to the WCF application.
In order to debug the issue and fix the communication, you need to configure the service to log messages received from the client What should you do?
A. Set an ETW Tracking behavior on the service and configure a listener for the System.ServiceModel trace source.
B. Set an ETW Tracking behavior on the service and configure a listener for the System.ServiceModel.MessageLogging trace source.
C. Enable message Logging in the System.ServiceModel diagnostics element configuration and configure a listener for the System.ServiceModel.MessageLogging trace source.
D. Enable message Logging in the System.ServiceModel diagnostics element configuration and configure a listener for the System.ServiceModel trace source.


Answer Clike
Which code segment should you use?

A Windows Communication Foundation (WCF) client configuration file contains the following XML segment in the system.serviceModel element.

You need to create a channel factory that can send messages to the endpoint listening at net.pipe://localhost/ContosoService which code segment should you use?
A. ChannelFactory <Contoso.IContoso> factory = new ChannelFactory <Contoso.IContoso>("Contoso.IContoso")
B. ChannelFactory <Contoso.IContoso> factory = new ChannelFactory <Contoso.IContoso>("netNamedPipeBinding")
C. ChannelFactory <Contoso.IContoso> factory = new ChannelFactory <Contoso.IContoso>("netPipe");
D. ChannelFactory <Contoso.IContoso> factory = new ChannelFactory <Contoso.IContoso>("net.pipe//localhost/ ContosoService");


Answer Clike
What are two possible ways to achieve this goal?

A Windows Communication Foundation (WCF) solution uses the following contracts. (Line numbers are included for reference only.)

When the client calls GetMessage on the service intetface, the service calls GetName on the client callback. In the client, the class NameService implements the callback contract.
The client channel is created as follows:

You need to ensure that the senvice callback is processed by the instance of NameService. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Change line 25 to the following code segment:
DuplexChannelFactory <IGreetingService> factory = new DuplexChannelFactory<IGreetingService> (callbackContext, binding, address);
B. Change line 26 to the following code segment:
IGreetingService greetingServicefactory = CreateChannel(callbackContext);
C. Add the following code segment after line 26:
callbackContextIncomingChannelsAdd((IDuplexChannel)greetingService)
D. Add the following code segment after line 26:
callbackContext.OutgoingChannels.Add((IDuplexChannel)greetingService)


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) service implements the following contract (Line numbers are included for reference only.)

The implementation of the SearchMessages method throws TimeoutFaultException exceptions for database timeouts.
The implementation of the SearchMessages method also throws an Exception for any other issue it encounters while processing the request. These exceptions are received on the client side as generic FaultException exceptions. You need to implement the error handling code for SearchMessages and create a new channel on the client only if the channel faults. What should you do?
A. Catch and handle both TimeoutFaultException and FaultException.
B. Catch both TimeoutFaultException and FaultException. Create a new channel in both cases.
C. Catch and handle TimeoutFaultException. Catch FaultException and create a new channel.
D. Catch and handle FaultException. Catch TimeoutFaultException and create a new channel.


Answer Clike
Which code segment should you use?

A Windows Communication Foundation (WCF) application uses the following data contract

You need to ensure that the following XML segment is generated when the data contract is serialized.

Which code segment should you use?
A.

B.

C.

D.



Answer Clike
Which code segment should you use?

The following is an example of a SOAP envelope.

You need to create a message contract that generates the SOAP envelope. Which code segment should you use?
A.

B.

C.

D.



Answer Clike
Which attribute should you apply to the MessageProcessor class?

You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows

SubmitOrder makes a call to another service. The ProcessMessage method does not perform as expected under a heavy load.
You need to enable processing of multiple messages. New messages must only be processed when the ProcessMessage method is not processing requests, or when it is waiting for calls to SubmitOrder to return.
Which attribute should you apply to the MessageProcessor class?
A. CallbackBehavior (ConcurrencyMode=ConcurencyMode.Reentrant)
B. CallbackBehavior (ConcurrencyMode=ConcurrencyMode.Multiple)
C. ServiceBehavior (ConcurrencyMode=ConcurrencyMode.Reentrant)
D. ServiceBehavior (ConcurrencyMode=ConcurrencyMode.Multiple)


Answer Clike
Which code segment should you use?

A Windows Communication Foundation (WCF) service implements the following contract.

The implementation is as follows:

The service is self-hosted, and the hosting code is as follows:

You need to implement CreateHost so that the service has a single endpoint hosted at http://localhost:8000/HelloService. Which code segment should you use?
A.

B.

C.

D.



Answer Clike
Which code segment should you use at line 10?

You are working with a Windows Communication Foundation (WCF) client application that has a generated proxy named SampleServiceProxy When the client application is executing, in line 04 of the following code, the channel faults (Line numbers are included for reference only.)

You need to return proxy to a state in which it can successfully execute the call in line 13. Which code segment should you use at line 10?
A. proxy.Close();
B. proxy = new SampleServiceProxy();
C. proxy.Abort();
D. proxy.Open();


Answer Clike
What should you do?

A Windows Communication Foundation (WCF) application uses a data contract that has several data members. You need the application to throw a SerializationException if any of the data members are not present when a serialized instance of the data contract is deserialized.
What should you do?
A. Add the Known Type attribute to the data contract.
Set a default value in each of the data member declarations.
B. Add the Known Type attribute to the data contract.
Set the Order property of each data member to unique integer value.
C. Set the Emit Default Value property of each data member to false.
D. Set the lsRequired property of each data member to true.


Answer Clike
Which code segment should you use?

You are creating a windows Communication Foundation (WCF) service. You do not want to expose the internal implementation at the service layer.
You need to expose the following class as a service named Arithmetic with an operation named Sum

Which code segment should you use?
A.

B.

C.

D.



Answer Clike
What should you do?

You are creating a Windows Communication Foundation (WCF) service that is implemented as follows.
(Line numbers are included for reference only.)

You need to ensure that the stack trace details of the exception are not included in the error information sent to the client. What should you do?
A. Replace line 14 with the following line. throw:
B. Replace line 14 with the following line
throw new FaultException<Order>(anOrder, ex.ToString());
C. After line 05, add the following line.
[FaultContract(typeof(FaultException<Order>))]
Replace line 14 with the following line
throw ex;
D. Alter line 05, add the following line
[FaultContract(typeof(FaultException<Order>))]
Replace line 14 with the following line.
throw new FaultException<Order>(anOrder, "Divide by zero exception");


Answer Clike