Microsoft TS: Microsoft .NET Framework 3.5 C Windows Communication Foundation Sample Questions:
1. You are creating a distributed application with Windows Communication Foundation by using Microsoft .NET Framework 3.5.
The distributed application topology includes client applications, routers, and services. Communication between the client applications and the services require authentication, confidentiality, and integrity.
You need to ensure that routers are not able to read the contents of the messages. You must achieve this goal without customizing the binding configuration.
Which binding should you use?
A) NetTcpBinding
B) WSHttpBinding
C) NetPeerTcpBinding
D) NetNamedPipeBinding
2. How to ensure SOAP envelope generation is always disabled for messages sent to the client?
A) ver = MessageVersion.None
B) ver = MessageVersion.Default
C) ver = MessageVersion.Soap11WSAddressing10
D) ver = OerationContext.Current.IncomingMessageVersion
3. You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
The WCF service must authenticate the client applications by validating credit card numbers and expiry dates. You write the following code segment. (Line numbers are included for reference only.)
01 class CreditCardTokenAuthenticator: SecurityTokenAuthenticator
02 {
03 // Implementation of other abstract methods comes here.
04 protected override ReadOnlyCollection<IAuthorizationPolicy> ValidateTokenCore(SecurityToken token)
05 {
06 CreditCardToken creditCardToken = token as CreditCardToken;
07 }
09 private bool IsCardValid(string cardNumber, 13 DateTime expirationDate)
10 {
11 // Validation code comes here.
12 }
13 }
You need to implement custom authentication for the WCF service. Which code segment should you insert at line 07?
A) if (IsCardValid(creditCardToken.CardNumber, creditCardToken.ValidTo))
return new List<IAuthorizationPolicy>(0).AsReadOnly();
else
return null;
B) if (IsCardValid(creditCardToken.CardNumber, creditCardToken.ValidTo))
throw new SecurityTokenValidationException();
else
return null;
C) if (IsCardValid(creditCardToken.CardNumber, creditCardToken.ValidTo))
return null;
else
return new List<IAuthorizationPolicy>(0).AsReadOnly();
D) if (IsCardValid(creditCardToken.CardNumber, creditCardToken.ValidTo))
return null;
else
throw new SecurityTokenValidationException();
4. You create a client application by using Microsoft .NET Framework 3.5. The client application consumes a Windows Communication Foundation service that uses the netMsmqBinding binding.
The binding uses a private transactional queue named Library.
The following code fragment is part of the application configuration file.
(Line numbers are included for reference only.)
01 <endpoint binding="netMsmqBinding"
02 contract="ServiceReference.ILibrary"
04 />
You need to specify the address of the endpoint. Which attribute should you insert at line 03?
A) Address="net.msmq://localhost/private/Library"
B) Address="net.msmq://localhost/private/transactional/Library"
C) Address=". \private$\Library"
D) Address="net.msmq://.\private$\Library"
5. You are creating a distributed application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation to create the application. You plan to perform the following tasks:
You write the following code segment.
You need to ensure that only those client applications that provide credentials belonging to the AdminGroup role can access the Remove method. What should you do?
A) Add the following attribute to the Service class <PrincipalPermission(SecurityAction. Demand,_ Name:="IService. Remove", Role:="AdminGroup")> _
B) Add the following attribute to the Service class. <PrincipalPermission(SecurityAction.
Demand, _ Name:="Remove", Role:="AdminGroup")> _
C) Add the following attribute to the Remove method of the Service class. <PrincipalPermission(SecurityAction.Demand, Role:="AdminGroup")> _
D) Add the following attribute to the Remove method of the IService interface. <PrincipalPermission(SecurityAction.Demand, Role:="AdminGroup")> _
Solutions:
| Question # 1 Answer: B | Question # 2 Answer: A | Question # 3 Answer: A | Question # 4 Answer: A | Question # 5 Answer: C |

We're so confident of our products that we provide no hassle product exchange.


By Candance


