微软认证考试070-320.doc_第1页
微软认证考试070-320.doc_第2页
微软认证考试070-320.doc_第3页
微软认证考试070-320.doc_第4页
微软认证考试070-320.doc_第5页
已阅读5页,还剩147页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Exam : 070-320Title : Developing XML Web Services and Server Components with Microsoft Visual C#.NETVer : 11/02/06QUESTION 1:070-320 You develop an application named ckApp. This application needs to run on the same computer as aWindows service named ckService. You want to ensure that ckService start

2、s from ckApp if ckService is not already running.Which code segment should you use?A. ServiceController ckServiceController = new ServiceController(ckService);if (ckServiceController.Status = ServiceControllerStatus.Stopped) ckServiceController.Start(); B. ServiceController ckServiceController = new

3、 ServiceController(ckService); ckServiceController.Start();C. String ckArgs = new string 1;ckArgs0 = ckService;ServiceController ckServiceController = new ServiceController();if (ckServiceController.Status = ServiceControllerStatus.Stopped) ckServiceController.Start(ckArgs); D. String ckArgs = new s

4、tring1;ckArgs0 = ckService;ServiceController ckServiceController = new ServiceController();myServiceController.Start(ckArgs);Answer: AQUESTION 2:Your Microsoft SQL Server database contains a table named CertK Orders. CertK Orders is used tostore new purchase orders as they are entered into an order-

5、entry application. To keep up withcustomer demand, the order fulfillment department wants to know at 15-minute intervals when neworders are entered.You need to develop an application that reads CertK Orders every 15 minutes and sends all neworders to the order fulfillment department. The application

6、 will run on computer that is used byseveral users who continuously log on and log off from the network to perform miscellaneous tasks.Which type of .NET application should you use?A. Windows Form B. Windows serviceC. XML Web serviceD. .NET Remoting objectAnswer: BExplanation: A Windows service woul

7、d still be running even though users logs on and off.Incorrect AnswersA - The Power of Knowing 070-320 A: A Windows Form would be closed when a user logs off.C: An XML Web service is not guaranteed to keep running if a user logs off.D: You can use .NET Remoting to enable different appl

8、ications to communicate with one another.However, a remoting object would be destroyed when a user logs off the system.SECTION 2: Create and consume a serviced component.SUBSECTION 1: Implement a serviced component. (4 questions)QUESTION 3:You create a serviced component named CertK Item that implem

9、ents an interface named I CertK Item.You want to ensure that calls to the serviced component through I CertK Item are queued.What should you do? A. To CertK Item, add the following attribute:InterfaceQueuing(true, Interface=I CertK Item)B. To CertK Item, add the following attribute:Transaction(Trans

10、actionOption.Disabled,Isolation=TransactionIsolationLevel.Serializable)C. To the CertK Item assembly, add the following attribute:assembly: ApplicationQueuing(Enabled=true,QueueListenerEnabled=true)D. In the CertK Item implementation, override the Activate method from the ServicedComponent class.In

11、the Activate method, add the following code segment:Queue q = new Queue(); q.Enqueue(this);Answer: CExplanation: In addition to enabling queued component support at the application level, you must markyour interfaces as capable of receiving queued calls. You do that by using setting theQueueListener

12、Enabled attribute to True.Note: The COM+ Queued Components (QC) service provides an easy way to invoke and executecomponents asynchronously. Processing can occur without regard to the availability or accessibility of eitherthe sender or receiver.Reference: .NET Framework Developers Guide, Queued Com

13、ponents C#Incorrect AnswersA: The signature for the InterfaceQueuing attribute as shown in Answer A is wrong.B: Transactions are not helpful for interface queuing configuration.D: Creating a new queue in the Active method is not correct in this scenario.QUESTION 4:You are creating a serviced compone

14、nt named ItemCKInventory. An online catalog application willuse ItemCKInventory to display the availability of products in inventory.Additional serviced components written by other developers will continuously update the inventorydata as orders are placed. The ItemCKInventory class includes the foll

15、owing code segment:A - The Power of Knowing _Public Class ItemCKInventoryInherits ServicedComponent Method code goes here.End Class070-320 ItemInventory is configured to require transactions. You want ItemInventory to respond to requestsas quickly as possible, even if that means displa

16、ying inventory values that are not up to date with themost recent orders.What should you do? A. To the ItemCKInventory class, add the following attribute:B. To all methods of the ItemCKInventory class, add the following attribute:C. Modify the Transaction attribute of the ItemCKInventory class to be

17、 the following attribute:D. Modify the Transaction attribute of the ItemCKInventory class to be the following attribute: Answer: DExplanation: The ReadUncommitted transaction isolation level makes a dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored. T

18、his will reduce the number of locks,compared to the default transaction isolation level of readcommitted. Reduced number of locks will increasethe performance.Incorrect AnswersA: Object pooling is a COM+ service that enables you to reduce the overhead of creating each objectfrom scratch. However, ob

19、ject pooling is not much use in transactions.B: Autocomplete does not apply here.C: Timeout configuration would not address performance issue.Reference: .NET Framework Class Library, IsolationLevel EnumerationQUESTION 5:You are creating a serviced component named UserManager. UserManager adds user a

20、ccounts tomultiple transactional data sources. The UserManager class includes the following code segment:Transaction(TransactionOption.Required)SecurityRole(Admin)public class UserManager : ServicedComponent public void AddUser(string CertK name, string CertK password) / Code to add the user to data

21、 sources goes here.A - The Power of Knowing 070-320 You must ensure that the AddUser method reliably saves the new user to either all data sources or nodata sources.What should you do? A. To AddUser, add the following attribute:AutoComplete()B. To UserManager, add the following attribu

22、te:JustInTimeActivation(false) C. To the end of AddUser, add the following line of code:ContextUtil.EnableCommit();D. To the end of AddUser, add the following line of code:ContextUtil.MyTransactionVote = true;Answer: CExplanation: The TransactionOption.Required shares a transaction, if one exists, a

23、nd creates anew transaction, if necessary. We should commit this transaction at the end of AddUser withContextUtil.EnableCommit ( ) statement.Reference: .NET Framework Class Library, ContextUtil MethodsIncorrect AnswersA: Autocomplete is out of context here.B: Just-in-time (JIT) activation is a COM+

24、 service that enables you to create an object as a nonactive,context-only object. JIT does not apply here.D: Not useful.QUESTION 6:You create two serviced components named OrderPipeline and OrderAdmin. Each component isregistered in a separate COM+ server application.Both components use pricing data

25、. OrderPipeline reads the pricing data for placing user orders.OrderAdmin modifies the pricing data.You want to ensure that OrderPipeline accesses the pricing data as quickly as possible, while stillbeing able to immediately retrieve any pricing changes made by OrderAdmin.What should you do? A. Stor

26、e the pricing data in the Shared Property Manager.B. Store the pricing data in Microsoft SQL Server database.C. Store the pricing data in a Hashtable object within OrderAdmin.Expose the Hashtable object through a property on OrderAdmin.D. Store the pricing data in an XmlDocument object within OrderA

27、dmin.Expose the XmlDocument object through a property on OrderAdmin.Answer: CExplanation: A Hashtable can safely support one writer and multiple readers concurrently. This is the mostefficient solutionA - The Power of Knowing Incorrect Answers070-320 A: A Shared Property Manager would

28、be a possible solution, however it is not required and is not themost efficient solution. Note: In COM+, shared transient state for objects is managed by using the Shared Property Manager(SPM). The SPM is a resource dispenser that you can use to share state among multiple objectswithin a server proc

29、ess.B: SQL Server could provide a solution. However, it would not be the most efficient solution.D: A hast table would be more efficient.Reference:.NET Framework Class Library, Hashtable.IsSynchronized PropertyPlatform SDK: COM+ (Component Services), The Shared Property Manager SUBSECTION 2: Createi

30、nterfaces that are visible to COM. (7 questions)QUESTION 7:You are using Visual Studio .NET to develop an application to replace a COM-based application. Aformer colleague began writing a .NET class for the new application. This class will be used by clientapplications as a COM object. You are assig

31、ned to finish writing the class.The class included the following code segment:Com Visible(false)public class CkClass public CkClass() / Implementation code goes here.ComVisible(true)public int CkMethod(string param) return 0; ComVisible(true)protected bool CkOtherMethod()return true;ComVisible(true)

32、public int CkProperty get return 0; / Other implementation code goes here.When this code runs, it will expose one or more methods to the client application through COM.Which member or members will be exposed? (Choose all that apply)A. CkMethodB. CkOtherMethodC. CkPropertyD. CkClass constructorActual

33、 - The Power of Knowing Answer: A, CQUESTION 8:070-320 You are using a Visual Studio .NET to develop an application that uses a non-COM DLL namedCertkiller Functions.dll. This DLL is written in unmanaged code.The DLL contains a function that parses a string into an array of string words and

34、 an array ofnumbers. A call to the function includes the following pseudocode:input = A string with 6 words and 2 numberswords = nullnumbers = nullParse(input, words, numbers)After execution, words contains all string words found in input and numbers contains all integersfound in input. You need to

35、enable your application to call this function.Which code segment should you use?A. DllImport( Certkiller Functions.dll) public static extern void Parse(string input, string words, intnumbers;B. DllImport( Certkiller Functions.dll) public static extern void Parse(string input, ref string words,ref in

36、t numbers); C. DllImport( Certkiller Functions.dll) public static extern void Parse(String inout, params stringwords, params int numbers);D. DllImport( Certkiller Functions.dll) public extern void Parse(string input, out string words, outint numbers;Answer: BQUESTION 9:You create a services componen

37、t named OrderStatus that is in an assembly named Certkiller Orders.OrderStatus is in its own COM+ application named Certkiller App.OrderStatus is used by multiple client applications to look up the status of orders. Because youanticipate that client applications will frequently access OrderStatus, y

38、ou need to ensure that themethod calls are processed as quickly as possible.What should you do? A. Configure OrderStatus to require a transaction. B. Configure Certkiller App to be a library application.C. Add the AutoComplete attribute to all methods in OrderStatus.D. Configure Certkiller Orders to

39、 be a shared assembly, and install it in the global assembly cache. A - The Power of Knowing Answer: BQUESTION 10:070-320 You are developing a Windows-based application that requires the use of a calculation functionnamed CalculateValue. This function includes the following signature:i

40、nt CalculateValue(int); CalculateValue is located in an unmanaged DLL named Certkiller Functions.dll, and is not part of aCOM interface. You need to be able to use CalculateValue in your application. Your project directorycontains a copy of Certkiller Functions.dll.While you are working in Debug mod

41、e, you attempt to run your application. However, aSystem.DllNotFoundException is thrown. You verify that you are using the correct function named.You also verify that the code in the DLL exposes CalculateValue. You have not modified the projectassembly, and you have not modified machine-level securi

42、ty. You need to test your applicationimmediately.What should you do? A. Move Certkiller Functions.dll to your projects bin directory.B. Move Certkiller Functions.dll to your projects Debug directory.C. Immediately before the declaration of CalculateValue, add the following code segment:SuppressUnman

43、agedCodeSecurityAttribute()D. Immediately before the call to CalculateValue, add the following code segment:SecurityPermission perm = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode);perm.Assert();Answer: BQUESTION 11:You are using Visual Studio .NET to develop an application named Certk

44、iller App. You have acommon business logic component that was created in COM that you want to use until you canreplace it with Visual Studio .NET code.You create the Visual Studio .NET solution for the new application. You want to use the COMcomponent in your Visual Studio .NET solution.What should

45、you do? A. Register the COM component by using Regsvr32.exe.B. Run the Type Library Exporter (Tlbexp.exe) and pass the COM component as the filename parameter.C. Use Visual Studio .NET to add a reference to the COM component.D. Run the Assembly Registration tool (Regasm.exe) and pass the COM compone

46、nt as the filename parameter.Answer: CA - The Power of Knowing 070-320 Explanation: We simply need to add a reference to the COM component.Incorrect AnswersA: Regsrv32 is not required in Visual Studio .NET. Regsrv32 was used for Visual Basic 6.0, and forVisual C+ 6.0 components.B: Tlbe

47、xp.exe generates a type library from a common language runtime assembly. Tlbexp.exegenerates a type library but does not register it.D: We only use Regasm.exe when we need to access .NET Framework classes in COM Clients.However, in this scenario we want to access the COM Component into our Visual St

48、udio .NETsolution. Note: To register or deregister a .NET class with COM, you must run a command-line tool called theAssembly Registration Tool (Regasm.exe). Regasm.exe adds information about the class to thesystem registry so COM clients can use the .NET class transparently.Reference:.NET Framework

49、 Developers Guide, Registering Assemblies with COM.NET Framework Tools, .NET Framework ToolsQUESTION 12:You are using Visual Studio .NET to develop a new application to replace an older COM-basedapplication. The new application will use some of the old COM components until they can be replacedby Vis

50、ual Studio .NET code.Your application uses a COM DLL named Certkiller COM.dll. The Visual Studio .NET assembly forCertkiller COM.dll must be named OurDotNetCOM. You must use the name ProjectX for thenamespace of the COM components. You must ensure that your application uses these namingguidelines.Wh

51、at should you do? A. Reference Certkiller COM.dllfrom Visual Studio .NET.Change the assembly name in Solution Explorer.Change the namespace name by editing the assembly.B. Reference Certkiller COM.dllfrom Visual .NET.Change the assembly name in Solution Explorer.Change the namespace name by using th

52、e Namespace property of a CodeNamespaceImport object.C. Run the Type Library Importer (Tlbimp.exe) with the /namespace and /out options to create theassembly.D. Run the Type Library Importer (Tlbimp.exe) with the /out option to create the assembly.Change the namespace by using the Namespace property

53、 of a CodeNamespaceImport object.Answer: CExplanation: The Type Library Importer converts the type definitions found within a COM type library intoequivalent definitions in a common language runtime assembly. We should use the /namespace option tospecify the namespace in which to produce the assembl

54、y. We must use the /out option to specify output file,assembly, and namespace in which to write the metadata definitions.Reference: .NET Framework Tools, Type Library Importer (Tlbimp.exe)A - The Power of Knowing Incorrect AnswersA: Not a practical solution.B: An incomplete solution.07

55、0-320 D: We should use the /namespace option to specify the namespace in which to produce the assembly.QUESTION 13:You are using Visual Studio .NET to develop an application to replace a COM-based application. Youare assigned to write a .NET class that will be used by client applications as a COM object. Your classcode is being moved and modified while development continues on the new application.You want to minim

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论