MS.NET Framework 2.0 - Distributed Appl Development
Index >> Microsoft >> MCTS >> "70-529"Exam
VUE/Prometric Code:70-529
Questions and Answers:240 Q&As
Price:$ 89
Updated:2008-12-01
| MS.NET Framework 2.0 - Distributed Appl Development | |||
| Test | Q&A | Updated | Price |
| 70-529 | 240 Q&A | 2008-12-01 | $ 89 |
please download in PDF format Demo:
killtest 70-529 Exam Features
High quality and Value for the 70-529 Exam.
Killtest Practice Exams for MS.NET Framework 2.0 - Distributed Appl Development 70-529 are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development.
100% Guarantee to Pass Your MCTS exam and get your MCTS Certification.
We guarantee your success in the first attempt. If you do not pass the 70-529 (MS.NET Framework 2.0 - Distributed Appl Development) on your first attempt we will give you a FULL REFUND of your purchasing fee AND send you another same value product for free.
killtest 70-529 Downloadable.
Printable Exams (in PDF format) Our Exam 70-529 Preparation Material provides you everything you will need to take your MCTS exam. The MCTS Certification details are researched and produced by Professional Certification Experts who are constantly using industry experience to produce precise, and logical. You may get MCTS exam questions from different web sites or books, but logic is the key. Our Product will help you not only pass in the first MCTS exam try, but also save your valuable time .
- Comprehensive questions with complete details about 70-529 exam.
- 70-529 exam questions accompanied by exhibits.
- Verified Answers Researched by Industry Experts and almost 100% correct.
- Drag and Drop questions as experienced in the Real MCTS exam.
- 70-529 exam questions updated on regular basis.
- Like actual MCTS Certification exams, 70-529 exam preparation is in multiple-choice questions (MCQs).
- Tested by many real MCTS exams before publishing.
- Try free MCTS exam demo before you decide to buy it in http://www.Killtest.com.
High quality and Value for the 70-529 Exam:100% Guarantee to Pass Your MCTS exam and get your MCTS Certification.
http://www.Killtest.com The safer.easier way to get MCTS Certification.
We offer Demo version of Q&A, Q&A are as follows (not to provide picture):
70-529:please download 70-529 in PDF format Demo 
A.Configure the server class as a Singleton Server Activated Object (SAO) and check for duplicate client delegate methods before raising the event.
B.Configure the server class as a Client Activated Object (CAO) and override the CreateObjRef method to check for duplicate client delegate methods before raising the event.
C.Configure the server class as a SingleCall Server Activated Object (SAO) and check for duplicate client delegate methods before raising the event.
D.Configure the server class as a Client Activated Object (CAO) and check for duplicate client delegate methods before raising the event.
Correct:A
2.You are converting an application to use .NET Framework remoting. The server portion of the application monitors stock prices and contains a class named StockPriceServer, which is a Server Activated Object (SAO). The client computer interacts with the server using a common assembly. When the server attempts to raise an event on the client computer, the server throws the following exception. System.IO.FileNotFoundException. You discover that the event delegate is not being called on the client computer. You need to ensure that the server application can raise the event on the client computer. What should you do?
A.Add the Serializable attribute to the StockPriceServer class and change the event to use one of the standard common language runtime (CLR) delegates.
B.In the common assembly, add an interface that contains the event and a method to raise the event. Implement that interface in the StockPriceServer class and use the interface's event to register the delegate message on the client computer.
C.Add the event delegate to the common assembly. Implement the Add delegate and the Remove delegate methods of the event in the StockPriceServer class to reference the delegate method in the client application.
D.Raise the event using the BeginInvoke method and pass a reference to the client computer.
Correct:B
3.You are writing a .NET Framework remoting client application that must call two remoting servers. The first server hosts an assembly that contains the following delegate and class definition. public delegate bool IsValidDelegate(string number, Int16 code); public class CreditCardValidator : MarshalByRefObject { public bool IsValid (string number, Int16 code) { //some data access calls that are slow under heavy load ... } } The second server hosts an assembly that contains the following delegate and class definition. public delegate float GetCustomerDiscountDelegate( int customerId); public class PreferredCustomer { public float GetCustomerDiscount(int customerId) { //some data access calls that are slow under heavy load ... } } You configure the remoting client application to call both server classes remotely. The amount of time it takes to return these calls varies, and long response times occur during heavy load times. The processing requires the result from both calls to be returned. You need to ensure that calls to both remoting servers can run at the same time. What should you do?
A.Write the following code segment in the client application. PreferredCustomer pc = new PreferredCustomer(); CreditCardValidator val = new CreditCardValidator(); double discount = pc.GetCustomerDiscount(1001); bool isValid = val.IsValid("4111-2222-3333-4444", 123);
B.Write the following code segment in the client application. PreferredCustomer pc = new PreferredCustomer(); GetCustomerDiscountDelegate del1 = new GetCustomerDiscountDelegate(pc.GetCustomerDiscount); CreditCardValidator val = new CreditCardValidator(); IsValidDelegate del2 = new IsValidDelegate(val.IsValid); double discount = del1.Invoke(1001); bool isValid = del2.Invoke("4111-2222-3333-4444", 123);
C.Write the following code segment in the client application. PreferredCustomer pc = new PreferredCustomer(); GetCustomerDiscountDelegate del1 = new GetCustomerDiscountDelegate(pc.GetCustomerDiscount); IAsyncResult res1 = del1.BeginInvoke(1001, null, null); CreditCardValidator val = new CreditCardValidator(); IsValidDelegate del2 = new IsValidDelegate( val.IsValid); IAsyncResult res2 = del2.BeginInvoke("4111-2222-3333-4444" , 123, null, null); WaitHandle[] waitHandles = new WaitHandle[] {res1.AsyncWaitHandle, res2.AsyncWaitHandle}; ManualResetEvent.WaitAll(waitHandles); double discount = del1.EndInvoke(res1); bool isValid = del2.EndInvoke(res2);
D.Write the following code segment in the client application. PreferredCustomer pc = new PreferredCustomer(); GetCustomerDiscountDelegate del1 = new GetCustomerDiscountDelegate(pc.GetCustomerDiscount); IAsyncResult res1 = del1.BeginInvoke(1001, null, null); double discount = del1.EndInvoke(res1); CreditCardValidator val = new CreditCardValidator(); IsValidDelegate del2 = new IsValidDelegate( val.IsValid); IAsyncResult res2 = del2.BeginInvoke("4111-2222-3333-4444", 123, null, null); bool isValid = del2.EndInvoke(res1);
Correct:C
4.A class library named MathLib contains the following code. public class MathClass : MarshalByRefObject { public decimal DoHugeCalculation(int iterations) { decimal result; //Some very lengthy calculations ... return result; } } The MathLib class is hosted in a .NET Framework remoting server application. A Windows application project running on a client computer contains the following class. public class MathClient { public void ProcessHugeCalculation(int iterations) { MathClass cm = new MathClass(); decimal decRes = cm.DoHugeCalculation(iterations); //process the result ... } } The MathClient class must call the MathClass class asynchronously by using remoting. A callback must be implemented to meet this requirement. You need to complete the implementation of the MathClient class. What should you do?
A.Modify the MathClient class as follows: public class MathClient { public delegate void DoHugeCalculationDelegate(decimal result); public event DoHugeCalculationDelegate DoHugeCalculationResult; public void DoHugeCalculationHandler(decimal result) { DoHugeCalculationResult(result);} public void ProcessHugeCalculation(int iterations) { //Hook up event handler here... ... } }
B.Apply the Serializable attribute to the MathClient class.
C.Modify the MathClient class as follows: public class MathClient { private delegate decimal DoHugeCalculationDelegate(int iterations); private void DoHugeCalculationCallBack(IAsyncResult res) { AsyncResult aRes = (AsyncResult)res; decimal decRes = ((DoHugeCalculationDelegate)aRes. AsyncDelegate).EndInvoke(res); //process the result ... } public void ProcessHugeCalculation(int iterations) { MathClass cm = new MathClass(); DoHugeCalculationDelegate del = new DoHugeCalculationDelegate( cm.DoHugeCalculation); del.BeginInvoke(iterations, new AsyncCallback( DoHugeCalculationCallBack), null); } }
D.Apply the OneWay attribute to all methods in the MathClass class.
Correct:C
5.You are writing an application that handles the batch processing of user accounts. The application assigns network identities for users by calling the following Web service method. [WebMethod] public string GetNetworkID(string name){ ... } The application calls the Web service using the following code. (Line numbers are included for reference only.) 01 void ProcessPeople(List people) { 02 PersonService serviceProxy = new PersonService(); 03 serviceProxy.GetNetworkIDCompleted += new 04 GetNetworkIDCompletedEventHandler(GetNetworkIDCompleted); 05 for (int i = 0; i < people.Count; i++) { 06 ... 07 } 08 } 09 10 void GetNetworkIDCompleted(object sender, 11 GetNetworkIDCompletedEventArgs e){ 12 Person p = null; 13 ... 14 p.NetworkID = e.Result; 15 ProcessPerson(p); 16 } You need to ensure that the application can use the data supplied by the Web service to update each Person instance. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A.Replace line 06 with the following code segment. serviceProxy.GetNetworkIDAsync(people[i].FirstName,people[i]);
B.Replace line 06 with the following code segment. serviceProxy.GetNetworkIDAsync(people[i].FirstName,null);
C.Replace line 13 with the following code segment. p = e.UserState as Person;
D.Replace line 13 with the following code segment. p = sender as Person;
Correct:A C
6.An application fails when executing a specific operation. You discover that the failure occurs when an exception is raised by a Web service. The application uses the following code to call the Web service. void Process() { ProcessService serviceProxy = new ProcessService(); serviceProxy.ProcessDataCompleted += new ProcessDataCompletedEventHandler(ServiceCompleted); serviceProxy.ProcessDataAsync(data); } You need to ensure that the application does not fail when the Web service raises the exception. Your solution must maximize the performance of your code. What should you do?
A.Register the following method with the proxy object to receive the notification of completion. void ServiceCompleted(object sender, ProcessDataCompletedEventArgs e){ if (sender is SoapException) LogMessage(e.Error.Message); else ProcessResult(e.Result); }
B.Register the following method with the proxy object to receive the notification of completion. void ServiceCompleted(object sender, ProcessDataCompletedEventArgs e){ if (e.Error is SoapException) LogMessage(e.Error.Message); else ProcessResult(e.Result); }
C.Register the following method with the proxy object to receive the notification of completion. void ServiceCompleted(object sender, ProcessDataCompletedEventArgs e){ try { ProcessResult(e.Result); } catch (Exception ex){ Console.WriteLine(ex.Message); } }
D.Register the following method with the proxy object to receive the notification of completion. void ServiceCompleted(object sender, ProcessDataCompletedEventArgs e) { if (e.Error != null) LogMessage(e.Error.Message); else ProcessResult(e.Result); }
Correct:D
7.A file named Util.asmx contains the following code segment. (Line numbers are included for reference only.) 01 02 namespace Exam { 03 public class Util { 04 public string GetData() { 05 return "data"; 06 } 07 } 08 } You need to expose the GetData method through a Web service. What should you do?
A.Insert the following line of code between lines 02 and 03. [System.Web.Services.WebService()]
B.Replace line 03 with the following line of code. public class Util : System.Web.Services.WebService
C.Insert the following line of code between lines 03 and 04. [System.Web.Services.WebMethod()]
D.Replace line 01 with the following line of code.
Correct:C
8.A Web service exposes a method named GetChart that returns an image. The data used to generate the image changes in one-minute intervals. You need to minimize the average time per request for CPU processing. What should you do?
A.Set the BufferResponse property on the WebMethod attribute of the GetChart method to True.
B.Set the BufferResponse property on the WebMethod attribute of the GetChart method to False.
C.Set the CacheDuration property on the WebMethod attribute of the GetChart method to 60.
D.Set the CacheDuration property on the WebMethod attribute of the GetChart method to 1.
Correct:C
9.You create a Web service. The Web service must be deployed on a remote Web server. You need to ensure that the deployment does not place the source code for the Web service on the Web server. What should you do?
A.Move the contents of the development Web site to the Web server.
B.Use the ASP.NET Compilation tool (Aspnet_compiler.exe) to compile the Web service locally. Move the resulting files to the Web server.
C.Add a Class attribute to the @WebService directive. Rebuild the Web service project and deploy it by using the Copy Web Site Wizard.
D.Add a CodeBehind attribute to the @WebService directive. Rebuild the Web service project and deploy it by using the Copy Web Site Wizard.
Correct:B
10.You create a Web service. The method in the Web service maintains session information between calls. When a client invokes the method, the following exception is thrown. System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. You need to ensure that the Web service method can be called without generating an exception. What should you do?
A.Use the WebService.Session object instead of the HttpContext.Session object to access the session variables.
B.Set the EnableSession property of the WebMethod attribute to True.
C.Set the ConformsTo property in the WebServiceBindingAttribute attribute to WsiProvfiles.BasicProfile1_1.
D.Set the AllowAutoRedirect property on the proxy class on the Web service client to True.
Correct:B
11.You create a Web service that exposes a Web method named CalculateStatistics. The response returned by the CalculateStatistics method for each set of input parameters changes every 60 seconds. You need to ensure that all requests to the CalculateStatistics method that have the same set of input parameters, and that occur within a 60-second time period, calculate the statistics only once. Which code segment should you use?
A.[WebMethod()] public string CalculateStatistics (int[] values) { HttpContext.Current.Response.Cache.SetCacheability( HttpCacheability.Public, "max-age=60"); ... }
B.[WebMethod(CacheDuration=60)] public string CalculateStatistics(int[] values) { ... }
C.[WebMethod()] public string CalculateStatistics (int[] values) { HttpContext.Current.Response.Cache.SetExpires( DateTime.Now.AddSeconds(60)); ... }
D.[WebMethod(BufferResponse=60)] public string CalculateStatistics(int[] values) { ... }
Correct:B
12.You use Microsoft Visual Studio 2005 to create a custom Web service discovery system that contains Disco files for your Web services. You need to have the Disco file for each of your Web services for auditing purposes. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A.Append the Disco parameter to the Web service's .asmx URL's querystring and save the returned data.
B.Open the Web service's Web services description language (WSDL) file and copy the method information into the Disco file for that Web service.
C.Add a reference to the Web service in Visual Studio 2005 and use the generated Disco file.
D.Append the Web services description language (WSDL) parameter to the Web service's .asmx URL's querystring and save the returned data.
Correct:A C
13.You create a Web service that will be deployed to a production Web server. You need to ensure that the first Web service request returns a response in the shortest amount of time possible. What should you do?
A.Run the ASP.NET Compilation tool (Aspnet_compiler.exe) on the Web service project. Copy the generated files to the Web server.
B.In the Web.config file, set the batch attribute in the compilation element to True. Deploy the .asmx files and the source code files to the Web server.
C.Set the CodeBehind attribute on the @WebService directive. Deploy the .asmx files and the source code files to the Web server.
D.Build the Web service project on the development platform. Deploy the .asmx files and the contents of all subdirectories to the Web server.
Correct:A
14.An administrator reports that when a client application runs, the application throws a RemotingException exception with the message: "Object '/40b4b673_e739_43df_abe4_ee269ff67173/0t_g9ytvvi_lgue2i9q5qrni_1.rem' has been disconnected or does not exist at the server". You discover the following information: The object causing the exception is configured as a Client Activated Object (CAO). The exception is thrown only if the client application is idle for more than five minutes. If the client application is idle for nine minutes, the client application shuts down and the user is logged out. You need to ensure that the CAO is available to the client application. What should you do?
A.Add the following XML to the App.config file for the client application.
B.Add the following code to the CAO class. public override object InitializeLifetimeService() { ILease lease = (ILease)base.InitializeLifetimeService(); if (LeaseState.Initial == lease.CurrentState) { lease.RenewOnCallTime = TimeSpan.FromMinutes(10); } return lease; }
C.Add the following code to the CAO class. public override object InitializeLifetimeService() { ILease lease = (ILease)base.InitializeLifetimeService(); if (LeaseState.Initial == lease.CurrentState) { lease.SponsorshipTimeout = TimeSpan.FromMinutes(10); } return lease; }
D.Add the following XML to the App.config file for the client application.
Correct:B
15.You create an assembly named SimpleMathLib.dll. SimpleMathLib.dll contains a namespace named SimpleMath. SimpleMath contains a .NET Framework remoting class named SimpleMathClass that inherits from the MarshalByRefObject class. You deploy the SimpleMathLib assembly to the Bin folder under an IIS server virtual directory named SimpleMathHost that is on a server named Server1. You need to configure the server application to initialize the SimpleMathClass class so that the class can be called by remoting client applications. What should you do?
A.Add the following XML to the configuration element of the Web.config file in the SimpleMathHost virtual directory.
B.Add the following XML code to the configuration element of the Web.config file in the SimpleMathHost virtual directory.
C.Add the following XML to the configuration element of the Web.config file in the SimpleMathHost virtual directory.
D.Add the following XML code to the configuration element of the Web.config file in the SimpleMathHost virtual directory. http: //server1/SimpleMathHost/SimpleMath.soap
Correct:C
16.A Windows service application must host a .NET Framework remoting class named SimpleMathClass. SimpleMathClass must have the following method, which can be called remotely. public double Add(double x, double y) { return x + y; } You need to create the SimpleMathClass class. What should you do?
A.Write the following class definition. public class SimpleMathClass : MarshalByRefObject { public double Add(double x, double y) { return x + y; } }
B.Write the following class definition. [AutomationProxy(true)] public class SimpleMathClass { public double Add(double x, double y) { return x + y; } }
C.Write the following class definition. [Serializable] public class SimpleMathClass { public double Add(double x, double y) { return x + y; } }
D.Write the following class definition. public class SimpleMathClass : ServicedComponent { public double Add(double x, double y) { return x + y; } }
Correct:A
17.An assembly named SimpleMathLib is deployed to the Bin folder that is under a virtual directory named SimpleMathHost, which is on an IIS server named SERVER1. The SimpleMathLib assembly contains the following code. namespace SimpleMath{ public class SimpleMathClass : MarshalByRefObject{ public double Add(double x, double y) { return x + y; } } The Web.config file under the SimpleMathHost virtual directory contains the proper configuration to host SimpleMath as a remoting object. You write a client Console Application and add a reference to the SimpleMathLib assembly. You need to ensure that the client Console Application calls the Add method on SERVER1 and returns the correct sum of the parameters to the Console Application. What should you do?
A.Write the following code in the client application. TcpChannel chan = new TcpChannel(); ChannelServices.RegisterChannel(chan, false); SimpleMath.SimpleMathClass sm = new SimpleMathClass(); Console.WriteLine(sm.Add(2, 2).ToString());
B.Write the following code in the client application. SimpleMathClass sm = (SimpleMathClass) Activator.GetObject(typeof(SimpleMathClass), "http: //server1:80/SimpleMathHost/SimpleMath.rem"); Console.WriteLine(sm.Add(2, 2).ToString());
C.Write the following code in the client application. SimpleMath.SimpleMathClass sm = (SimpleMathClass) Activator.GetObject(typeof(SimpleMathClass), "tcp: //server1:80/SimpleMathHost/SimpleMath.rem"); Console.WriteLine(sm.Add(2, 2).ToString());
D.Write the following code in the client application. SimpleMath.SimpleMathClass sm = (SimpleMathClass) Activator.CreateInstance(typeof(SimpleMathClass), new string[] {"http: //server1:80/SimpleMathHost/SimpleMath.rem", "SimpleMath.SimpleMathClass, SimpleMathLib"}); Console.WriteLine(sm.Add(2, 2).ToString());
Correct:B
18.An administrator reports that a .NET Framework remoting application named MyServer has poor performance. You want to observe the application's performance during a high-activity time period. You run System Monitor on the computer that is running MyServer. You need to add the correct performance counter to the details view of System Monitor. What should you do?
A.Add the _Global_ instance of the Remote Calls/sec counter from the .NET CLR Remoting performance object.
B.Add the MyServer instance of the Remote Calls/sec counter from the .NET CLR Remoting performance object.
C.Add the _Global_ instance of the Total Remote Calls counter from the .NET CLR Remoting performance object.
D.Add the MyServer instance of the Total Remote Calls counter from the .NET CLR Remoting performance object.
Correct:B
19.A Web service application uses Web Services Enhancements (WSE) 3.0. A class named RejectUnknownActorFilter is derived from the SoapFilter class. The RejectUnknownActorFilter class throws a SoapException exception if the request contains an unexpected actor. A class defines a policy assertion as follows. (Line numbers are included for reference only.) 01 public class RequireActorAssertion : PolicyAssertion { 02 public override SoapFilter 03 CreateClientInputFilter(FilterCreationContext context) { 04 return null; 05 } 06 public override SoapFilter 07 CreateClientOutputFilter(FilterCreationContext context) { 08 return null; 09 } 10 public override SoapFilter 11 CreateServiceInputFilter(FilterCreationContext context) { 12 return null; 13 } 14 public override SoapFilter 15 CreateServiceOutputFilter(FilterCreationContext context) { 16 return null; 17 } 18 } You need to ensure that the Web service rejects any SOAP request that contains an unexpected actor. Your code must minimize the server resources used to process the request. What should you do?
A.Replace line 04 with the following line of code.return new RejectUnknownActorFilter();
B.Replace line 08 with the following line of code.return new RejectUnknownActorFilter();
C.Replace line 12 with the following line of code.return new RejectUnknownActorFilter();
D.Replace line 16 with the following line of code.return new RejectUnknownActorFilter();
Correct:C
20.A Web Services Enhancements (WSE) 3.0 router application uses a referral cache to make routing decisions. When a client application sends a SOAP message to the WSE router application, the following exception is thrown. Microsoft.Web.Services3.Addressing.AddressingFault: Message Information Header Required The referral cache used by the WSE router application is as follows:
A.Set the AllowAutoRedirect property on the Web service client proxy to True.
B.Change the Web service client proxy class definition so that it is derived from the Microsoft.Web.Services3.WebServicesClientProtocol class.
C.Set the ConnectionGroupName property on the Web service client proxy to Allow Routing.
D.Set the UserAgent property on the Web service client proxy to WSE 3.0.
Correct:B
21.You are writing a Web service application that uses Web Services Enhancements (WSE) 3.0 policies. The Web service request and response data must be signed. Routing occurs between the client and server computers, and uses the Action SOAP header of the SOAP messages. You need to ensure that the SOAP signature is not invalidated when the SOAP message is routed. What should you do?
A.In the policy file, set the signatureOptions attribute to IncludeAddressing.
B.In the policy file, set the signatureOptions attribute to IncludeSoapBody.
C.Sign the SOAP request with a UserName token that includes a password to allow the SOAP message to be signed again during routing.
D.Sign a SOAP request that encapsulates the initial SOAP request.
Correct:B
22.You have a Web service that is deployed on an unsecured network. You need to implement encryption on the Web service. The implementation must be configurable at run time. What should you do?
A.Write a custom SOAP extension attribute class to encrypt and decrypt the SOAP message. Apply the attribute to the Web service class.
B.Apply Web Services Enhancements (WSE) 3.0 security to the Web service that is configured to use an X.509 certificate with the Sign and Encrypt protection level.
C.Apply Web Services Enhancements (WSE) 3.0 security to the Web service that is configured to use an X.509 certificate with the Sign-Only protection level.
D.Write custom code in each Web method of the Web service that encrypts the data by using the DESCryptoServiceProvider class.
Correct:B
23.You are creating a Windows-based application that allows users to store photographs remotely by using a Web service. Both the Web service and the application are configured to use Web Services Enhancements (WSE) 3.0. You need to configure the application to ensure that a photograph can be sent to the Web service. What should you do?
A.Write the following code segment in the application. ImageServiceWse serviceProxy = new ImageServiceWse(); byte[] img = GetImageBytes(); serviceProxy.RequestSoapContext.Add(imageName, img); serviceProxy.SaveImage(null, imageName);
B.Write the following code segment in the application. ImageServiceWse serviceProxy = new ImageServiceWse(); byte[] img = GetImageBytes(); serviceProxy.SaveImage(img, imageName);
C.Write the following code segment in the application. ImageService serviceProxy = new ImageService(); serviceProxy.SoapVersion = SoapProtocolVersion.Soap12; byte[] img = GetImageBytes();serviceProxy. SaveImage(img, imageName);
D.Write the following code segment in the application. ImageService serviceProxy = new ImageService(); serviceProxy.UserAgent = "Microsoft WSE 3.0"; byte[] img = GetImageBytes();serviceProxy. SaveImage(img, imageName);
Correct:B
24.A client application calls a Web service named Math. Both the client application and Math are configured with a Web Services Enhancements (WSE) 3.0 policy named Secure to validate anonymous access for certificate security. A Web reference to the Math Web service is added to the client application's project using Microsoft Visual Studio 2005. When the client application is built and executed, a SoapException exception is thrown with the following message. The security requirements are not met because the security header is not included in the incoming message. You need to ensure that the application runs without throwing the SoapException exception. What should you do?
A.Add the following attribute to the Math proxy class definition. [Microsoft.Web.Services3.Policy("Secure")]
B.Set the Name property for the WebServiceBindingAttribute attribute on the Math proxy class definition to MathWseSoap.
C.Add the following attribute to the Math proxy class definition. [Microsoft.Web.Services3.Policy("anonymousForCertificateSecurity")]
D.Modify the Math proxy class so that it derives from the following protocol. System.Web.Services.Protocols.SoapHttpClientProtocol
Correct:A
25.A Windows Forms application calls in to a Web service named SensitiveData. The project has a Web reference named SensitiveDataWS. The code uses a class of type SensitiveDataWS.Service. SensitiveDataWS.Service is a proxy to the Web service. An administrator reports that users running the client application receive a SoapHeaderException exception with the following message text: "Security requirements are not satisfied because the security header is not present in the incoming message". You discover that the Web Services Enhancements (WSE) 3.0 policy file for the Web service was changed to require the encryption of SOAP messages. You acquire the X.509 certificate that is used for encryption in the Web service. You need to ensure that the Windows Forms application meets the new security requirements of the Web service. What should you do?
A.In each Web method, assign an instance of the X509Certificate class that is initialized with the acquired X.509 certificate, to the ClientCertificates property of the SensitiveDataWS.Service class.
B.Apply WSE security to the Windows Forms project that is configured to use the acquired X.509 certificate with the Sign and Encrypt protection level.Renew the Web reference and modify the code to use the new SensitiveDataWS.ServiceWse class.
C.Apply WSE security to the Windows Forms project that is configured to use the acquired X.509 certificate with the Sign-Only protection level.Renew the Web reference and modify the code to use the new SensitiveDataWS.ServiceWse class.
D.In the Windows Forms project, create a custom class that inherits from the SoapHeader attribute class with a public property of type X509Certificate.Initialize the public property with the acquired X.509 certificate.Apply the created attribute to code in the client application that calls the Web service.Initialize the attribute with the name of the custom class.
Correct:B
26.A Web service named Math uses Web Service Enhancements (WSE) 3.0 policy assertions that are defined in the policy configuration file to implement security. The Web service authenticates access to the Web methods using the UsernameOverTransportAssertion policy assertion. A client application must call a Web method on the Math Web service. When the client application is executed, it throws an InvalidOperationException exception that displays the following text. Unable to determine client token to use. Client token type requested was 'Microsoft.Web.Services3.Security.Tokens.UsernameToken'. The following code is used to invoke the Web method. (Line numbers are included for reference only.) 01 Math ws = new Math(); 02 ws.SetPolicy("Secure"); 03 int result = ws.Add(3, 4); You need to ensure that the Web methods can be invoked without causing the client application to throw the InvalidOperationException exception. What should you do?
A.Add the following code between lines 02 and 03. ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
B.Add the following code between lines 02 and 03. ws.Credentials = new System.Net.NetworkCredentials(userId, password);
C.Add the following code between lines 02 and 03. ws.SetServiceCredential(new UsernameToken(userId, password));
D.Add the following code between lines 02 and 03. ws.SetClientCredential(new UsernameToken(userId, password));
Correct:D
27.An application logs information about messages that pass through a message queue, including message contents. The application must run once for each message. You need to ensure that the application is executed for every message. Your solution must not prevent other processes from receiving the messages on the same queue. What should you do?
A.Create a Windows service application.Use the Peek method to retrieve message contents as messages arrive in the queue. Pass the message contents to the logging application.
B.Create a Windows service application.Use the Peek method to find out when a message arrives in the message queue.Use the ReceiveById method to retrieve the message contents.Pass the message contents to the logging application.
C.Create a Message Queuing trigger that executes the logging application.Define the trigger rule to pass the message contents as a string parameter to the logging application.
D.Create a Message Queuing trigger that executes the logging application.Define the trigger rule to pass the message ID as a parameter to the logging application.Use the ReceiveById method on the MessageQueue object to retrieve the message content within the logging application.
Correct:C
28.A .NET Framework application receives messages from a private message queue named MyQueue. The private queue exists on a computer named APPSERVER1. A user in a domain named CONTOSO has the username dhall. This user reports that when he attempts to run the application, he receives a MessageQueueException exception with the error message text "Access to Message Queuing system is denied." You need to ensure that CONTOSO\dhall can receive messages from MyQueue using the .NET Framework application. Your solution must not give dhall unnecessary privileges. What should you do?
A.Write the following code segment. MessageQueue q = new MessageQueue(@"APPSERVER1\Private$\MyQueue"); q.SetPermissions(@"contoso\dhall" , MessageQueueAccessRights.FullControl );
B.Write the following code segment. MessageQueuePermissionEntry mqpe = new MessageQueuePermissionEntry( MessageQueuePermissionAccess.Receive , @"APPSERVER1\Private$\MyQueue" , @"contoso\dhall" , null ); MessageQueuePermission p = new MessageQueuePermission(new MessageQueuePermissionEntry[] { mqpe }); p.Demand();
C.Write the following code segment. MessageQueuePermissionEntry mqpe = new MessageQueuePermissionEntry( MessageQueuePermissionAccess.Administer , @"APPSERVER1\Private$\MyQueue " , @"contoso\dhall" , null ); MessageQueuePermission p = new MessageQueuePermission(new MessageQueuePermissionEntry[] { mqpe }); p.Demand();
D.Write the following code segment. MessageQueue q = new MessageQueue(@"APPSERVER1\Private$\MyQueue"); q.SetPermissions(@"contoso\dhall" , MessageQueueAccessRights.GenericRead );
Correct:D
29.A message queue named SecureQueue requires each incoming message to be encrypted. You need to ensure that a message can be sent to the SecureQueue queue without an exception being thrown. What should you do?
A.Set the EncryptionAlgorithm property on the message to a value from the EncryptionAlgorithm enumeration.
B.Set the UseEncryption property on the message to True.
C.Set the HashAlgorithm property on the message to a value from the HashAlgorithm enumeration.
D.Use the CryptoStream class to encrypt the Body property on the message.
Correct:B
30.An application has components named ComponentA, ComponentB, and ComponentC. ComponentA and ComponentB update tables in a database named DB1. ComponentC updates tables in a database named DB2. At run time, ComponentA is executed with either ComponentB or ComponentC in a single transaction. You need to compose the transaction to minimize the use of the system resources. What should you do?
A.Write the following code for the transaction. [AutoComplete] void ExecuteTransactions() { ... }
B.Write the following code for the transaction. void ExecuteTransactions() { try { ... ContextUtil.SetComplete(); } catch { ContextUtil.SetAbort(); } }
C.Write the following code for the transaction. void ExecuteTransactions() { SqlConnection connection = new SqlConnection(...); SqlTransaction trans = connection.BeginTransaction(); try { ... trans.Commit(); } catch { trans.Rollback(); } }
D.Write the following code for the transaction. void ExecuteTransactions() { using (TransactionScope txscope = new TransactionScope()) { ... txscope.Complete(); } }
Correct:D


