Microsoft 70-521 Training
Article by testkingworld.net
Upgrade: Transition your MCPD .NET Framework 3.5 Windows Developer Skills to MCPD .NET 4 Windows Applications Developer 70-521 Test
Exam Name: UPG:Trans MCPD.NET Frmwk 3.5 Dev Skil to .NET 4 Wndws App Development Exam Type: Microsoft Exam Code: 70-521 Certification Microsoft Certified Professional Developer Total Questions: 108 (MCPD)
Question: 1You are creating a Windows Communication Foundation (WCF) service that isimplemented as follows.(Line numbers are included for reference only.)01 [ServiceContract]02 [ServiceBehavior(IncludeExceptionDetailsInFaults = true)]03 public class OrderService04 {05 [OperationContract]06 public void SubmitOrder(Order anOrder)07 {08 try09 {10 …11 }12 catch(DivideByZeroException ex)13 {15 }16 }17 }You need to ensure that the stack trace details of the exception are not included in the errorinformation 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(anOrder, ex.ToString());C. After line 05, add the following line. [FaultContract(typeof(FaultException))] Replace line 14 with the following line. throw ex;D. After line 05, add the following line. [FaultContract(typeof(FaultException))] Replace line 14 with the following line. throw new FaultException(anOrder, “Divide by zero exception”);
Answer: D
Question: 2You are creating a Windows Communication Foundation (WCF) service. You do not want toexpose the internal implementation at the service layer. You need to expose the following classas 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) { …
Page 1 of 49 Exam Name: UPG:Trans MCPD.NET Frmwk 3.5 Dev Skil to .NET 4 Wndws App Development Exam Type: Microsoft Exam Code: 70-521 Certification Microsoft Certified Professional Developer Total Questions: 108 (MCPD)
} }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
Question: 3A Windows Communication Foundation (WCF) application uses a data contract that has severaldata members. You need the application to throw a SerializationException if any of the datamembers are not present when a serialized instance of the data contract is deserialized. Whatshould 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
Question: 4You are creating a Windows Communication Foundation (WCF) service that implementsoperations in a RESTful manner. You need to add a delete operation. You implement thedelete method as follows.void DeleteItems(string id);You need to configure WCF to call this method when the client calls the service with the HTTPDELETE operation.
Page 2 of 49 Exam Name: UPG:Trans MCPD.NET Frmwk 3.5 Dev Skil to .NET 4 Wndws App Development Exam Type: Microsoft Exam Code: 70-521 Certification Microsoft Certified Professional Developer Total Questions: 108 (MCPD)
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
Question: 5You 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. ChannelFactoryB. ServiceHostC. ClientRuntimeD. CommunicationObject
Answer: A
Question: 6A Windows Communication Foundation (WCF) service has a callback contract. You aredeveloping a client application that will call this service. You must ensure that the clientapplication 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.D. On the client, use GetCallbackChannel.
Answer: C
Question: 7You are consuming a Windows Communication Foundation (WCF) service in an ASP.NET Webapplication. 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 asindicated 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) { …
Page 3 of 49 Exam Name: UPG:Trans MCPD.NET Frmwk 3.5 Dev Skil to .NET 4 Wndws App Development Exam Type: Microsoft Exam Code: 70-521 Certification Microsoft Certified Professional Developer Total Questions: 108 (MCPD)
}, “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
Question: 8You are developing an application to update a user’ s social status. You need to consume theservice using Windows Communication Foundation (WCF).The client configuration is as follows.
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 factory = new WebChannelFactory(“SocialClient”)) { factory.Credentials.UserName.UserName = user.Name; factory.Credentials.UserName.Password = user.Password; ISocialStatus socialChannel = factory.CreateChannel(); socialChannel.UpdateStatus(newStatus); }B. using (ChannelFactory factory = new WebChannelFactory(typeof(ISocialStatus))) {
Page 4 of 49 Exam Name: UPG:Trans MCPD.NET Frmwk 3.5 Dev Skil to .NET 4 Wndws App Development Exam Type: Microsoft Exam Code: 70-521 Certification Microsoft Certified Professional Developer Total Questions: 108 (MCPD)
factory.Credentials.UserName.UserName = user.Name; factory.Credentials.UserName.Password = user.Password; ISocialStatus socialChannel = factory.CreateChannel(); socialChannel.UpdateStatus(newStatus); }C. using (ChannelFactory factory = new ChannelFactory(“POST”)) { factory.Credentials.Windows.ClientCredential.UserName = user.Name; factory.Credentials.Windows.ClientCredential.SecurePassword. SetAt(0, Convert.ToChar(user.Password)); ISocialStatus socialChannel = factory.CreateChannel(); socialChannel.UpdateStatus(newStatus); }D. using (WebChannelFactory factory = new WebChannelFactory(typeof(ISocialClient))) { factory.Credentials.Windows.ClientCredential.UserName = user.Name; factory.Credentials.Windows.ClientCredential.SecurePassword. SetAt(0, Convert.ToChar(user.Password)); ISocialStatus socialChannel = factory.CreateChannel(); socialChannel.UpdateStatus(newStatus); }
Answer: A
Question: 9You are creating a Windows Communication Foundation (WCF) service to process orders. Thedata 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 thecontents of CreditCardNumber are not sent across the network in clear text. Ensure that thecontents of CreditCardNumber are accessible by the service to process the order. You need toimplement 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
Page 5 of 49
Original Resource : http://www.testkingworld.net
Visit 70-521 Link : 70-521 Download PDF Link : 70-521
About the Author
Original Resource : http://www.testkingworld.net
Visit 70-521 Link : 70-521
Microsoft 10-184 TrainingMicrosoft 111-056 TrainingMicrosoft 70-015 TrainingMicrosoft 70-016 TrainingMicrosoft 70-019 TrainingMicrosoft 70-028 TrainingMicrosoft 70-029 TrainingMicrosoft 70-086 TrainingMicrosoft 70-088 TrainingMicrosoft 70-089 TrainingMicrosoft 70-100 TrainingMicrosoft 70-121 TrainingMicrosoft 70-122 TrainingMicrosoft 70-123 TrainingMicrosoft 70-152 TrainingMicrosoft 70-176 TrainingMicrosoft 70-210 TrainingMicrosoft 70-214 TrainingMicrosoft 70-215 TrainingMicrosoft 70-216 TrainingMicrosoft 70-217 TrainingMicrosoft 70-218 TrainingMicrosoft 70-219 TrainingMicrosoft 70-220 TrainingMicrosoft 70-221 TrainingMicrosoft 70-222 TrainingMicrosoft 70-223 TrainingMicrosoft 70-224 TrainingMicrosoft 70-225 TrainingMicrosoft 70-226 TrainingMicrosoft 70-227 TrainingMicrosoft 70-228 TrainingMicrosoft 70-229 TrainingMicrosoft 70-230 TrainingMicrosoft 70-232 TrainingMicrosoft 70-234 TrainingMicrosoft 70-235 TrainingMicrosoft 70-236 TrainingMicrosoft 70-237 TrainingMicrosoft 70-238 TrainingMicrosoft 70-240 TrainingMicrosoft 70-241 TrainingMicrosoft 70-244 TrainingMicrosoft 70-262 TrainingMicrosoft 70-270 TrainingMicrosoft 70-271 TrainingMicrosoft 70-272 TrainingMicrosoft 70-281 TrainingMicrosoft 70-282 TrainingMicrosoft 70-284 TrainingMicrosoft 70-285 TrainingMicrosoft 70-290 TrainingMicrosoft 70-291 TrainingMicrosoft 70-292 TrainingMicrosoft 70-293 TrainingMicrosoft 70-294 TrainingMicrosoft 70-296 TrainingMicrosoft 70-297 TrainingMicrosoft 70-298 TrainingMicrosoft 70-299 TrainingMicrosoft 70-300 TrainingMicrosoft 70-301 TrainingMicrosoft 70-305 TrainingMicrosoft 70-306 TrainingMicrosoft 70-310 TrainingMicrosoft 70-315 TrainingMicrosoft 70-316 TrainingMicrosoft 70-320 TrainingMicrosoft 70-330 TrainingMicrosoft 70-340 TrainingMicrosoft 70-350 TrainingMicrosoft 70-351 TrainingMicrosoft 70-400 TrainingMicrosoft 70-401 TrainingMicrosoft 70-403 TrainingMicrosoft 70-431 TrainingMicrosoft 70-432 TrainingMicrosoft 70-433 TrainingMicrosoft 70-441 TrainingMicrosoft 70-442 TrainingMicrosoft 70-443 TrainingMicrosoft 70-444 TrainingMicrosoft 70-445 TrainingMicrosoft 70-446 TrainingMicrosoft 70-447 TrainingMicrosoft 70-448 TrainingMicrosoft 70-450 TrainingMicrosoft 70-451 TrainingMicrosoft 70-452 Training
More Skil Articles
