Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
CWNP exams CWNP
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
GIAC exams GIAC
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
ISEB exams ISEB
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

Microsoft 70-521 Exam - Cheat-Test.com

Free 70-521 Sample Questions:

Q: 1
You are creating a Windows Communication Foundation (WCF) service that is implemented as follows.
(Line numbers are included for reference only.)
01 [ServiceContract]
02 [ServiceBehavior(IncludeExceptionDetailsInFaults = true)]
03 public class OrderService
04 {
05 [OperationContract]
06 public void SubmitOrder(Order anOrder)
07 {
08 try
09 {
10 …
11 }
12 catch(DivideByZeroException ex)
13 {
14
15 }
16 }
17 }
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. After 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: D

Q: 2
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. public class Calculator {
public int Add(int x, int y)
{
}
}
Which code segment should you use?
A. [ServiceContract(Namespace="Arithmetic")]
public class Calculator
{
[OperationContract(Action="Sum")]
public int Add(int x, int y)
{

}
}
B. [ServiceContract(ConfigurationName="Arithmetic")]
public class Calculator
{
[OperationContract(Action="Sum")]
public int Add(int x, int y)
{

}
}
C. [ServiceContract(Name="Arithmetic")]
public class Calculator
{
[OperationContract(Name="Sum")]
public int Add(int x, int y)
{

}
}
D. [ServiceContract(Name="Arithmetic")]
public class Calculator
{
[OperationContract(ReplyAction="Sum")]
public int Add(int x, int y)
{

}
}
Answer: C

Q: 3
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 KnownType attribute to the data contract. Set a default value in each of the data member declarations.
B. Add the KnownType attribute to the data contract. Set the Order property of each data member to unique integer value.
C. Set the EmitDefaultValue property of each data member to false.
D. Set the IsRequired property of each data member to true.
Answer: D

Q: 4
You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner. You need to add a delete operation. You implement the delete method as follows. void DeleteItems(string id);
You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation. What should you do?
A. Add the WebInvoke(UriTemplate = "/Items/{id}", Method="DELETE") attribute to the operation.
B. Add the HttpDelete attribute to the operation.
C. Replace the string parameter with a RemovedActivityAction parameter.
D. Replace the return type with RemovedActivityAction.
Answer: A

Q: 5
You are building a client for a Windows Communication Foundation (WCF) service.
You need to create a proxy to consume this service. Which class should you use?
A. ChannelFactory<TChannel>
B. ServiceHost
C. ClientRuntime
D. CommunicationObject
Answer: A

Q: 6
A Windows Communication Foundation (WCF) service has a callback contract. You are developing a client application that will call this service. You must ensure that the client application can interact with the WCF service. What should you do?
A. On the OperationContractAttribute, set the AsyncPattern property value to true.
B. On the OperationContractAttribute, set the ReplyAction property value to the endpoint address of the client.
C. On the client, create a proxy derived from DuplexClientBase<TChannel>.
D. On the client, use GetCallbackChannel<T>.
Answer: C

Q: 7
You are consuming a Windows Communication Foundation (WCF) service in an ASP.NET Web application. The service interface is defined as follows.
[ServiceContract]
public interface ICatalog
{
[OperationContract]
[WebGet(UriTemplate = "/Catalog/Items/{id}",
ResponseFormat = WebMessageFormat.Json)]
string RetrieveItemDescription(int id);
}
The service is hosted at /Catalog.svc.
You need to call the service using jQuery to retrieve the description of an item as indicated by a variable named itemId.
Which code segment should you use?
A. $.get(String.format("/Catalog.svc/Catalog/Items/?id={0}", itemId)
null,
function (data) {

},
"javascript");
B. $.get(String.format("/Catalog.svc/Catalog/Items/{0}", itemId),
null,
function (data) {

},
"json");
C. $.get(String.format("/Catalog.svc/Catalog/Items/{0}", itemId),
null,
function (data) {

},
"xml");
D. $.get(String.format("/Catalog.svc/Catalog/Items/id={0}", itemId),
null,
function (data) {

},
"json");
Answer: B

Q: 8
You are developing an application to update a user’s social status. You need to consume the service using Windows Communication Foundation (WCF).
The client configuration is as follows.
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="SocialConfig">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic"
?realm="Social API" />
</security>
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address="http://contoso.com"
binding="webHttpBinding"
bindingConfiguration="SocialConfig"
contract="ISocialStatus"
name="SocialClient" />
</client>
</system.serviceModel>
The service contract is defined as follows.
[ServiceContract]
public interface ISocialStatus
{
[OperationContract]
[WebInvoke(UriTemplate =
"/statuses/update.xml?status={text}")]
void UpdateStatus(string text);
}
Which code segment should you use to update the social status?
A. using (WebChannelFactory<ISocialStatus> factory =
new WebChannelFactory<ISocialStatus>("SocialClient"))
You are developing an application to update a user’s social status. You need to consume the
service using Windows Communication Foundation (WCF).
The client configuration is as follows.
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="SocialConfig">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic"
?realm="Social API" />
</security>
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address="http://contoso.com"
binding="webHttpBinding"
bindingConfiguration="SocialConfig"
contract="ISocialStatus"
name="SocialClient" />
</client>
</system.serviceModel>
The service contract is defined as follows.
[ServiceContract]
public interface ISocialStatus
{
[OperationContract]
[WebInvoke(UriTemplate =
"/statuses/update.xml?status={text}")]
void UpdateStatus(string text);
}
Which code segment should you use to update the social status?
A. using (WebChannelFactory<ISocialStatus> factory =
new WebChannelFactory<ISocialStatus>("SocialClient"))
Answer: A

Q: 9
You are creating a Windows Communication Foundation (WCF) service to process orders.
The data contract for the order is defined as follows.
[DataContract]
public class Order
{

[DataMember]
public string CardHolderName { get; set; }
[DataMember]
public string CreditCardNumber { get; set; }
}
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 EncryptAndSign.
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: B

Q: 10
A Windows Communication Foundation (WCF) client uses the following service contract.
(Line numbers are included for reference only.)
01 [ServiceContract]
02 public interface IService
03 {
04 [OperationContract]
05 string Operation1();
06 [OperationContract]
07 string Operation2();
08 }
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 for each operation.
D. Add a SecuritySafeCriticalAttribute for each operation.
Answer: A


© 2014 Cheat-Test.com, All Rights Reserved