Practice Questions

Question 1

Which of the following is the best description of the general purpose of SOAP?

  • A. SOAP is used to automatically discover the properties and methods of a Web service.

  • B. SOAP is used to create a proxy class for a Web service.

  • C. SOAP is used to encapsulate objects and method calls as XML messages.

  • D. SOAP is used to clean data before it is consumed by a Web service.

A1:

Answer C is correct. SOAP is used to encapsulate objects, along with their properties and methods, as XML messages so that they may be transferred over a network using protocols such as HTTP, FTP, and SMTP. Answer A is incorrect because SOAP is used to translate the properties and methods of an object into XML and is not directly able to perform discovery of Web services and their properties. Answer B is incorrect because SOAP is a method of data interchange and does not create a Web service or a proxy class for one. Answer D is incorrect because SOAP does not provide error checking of user data; it only serves to provide basic XML transfer of data.

Question 2

You have created the file NewService.asmx containing code for a new Web service named MyService. The code contains the exposed methods FirstService and SecondService . In order to expose the FirstService method, which of the following must be done to the method?

  • A. Configure NewService.asmx for anonymous access.

  • B. Configure MyService using the <WebClass> attribute.

  • C. Configure FirstService using the <WebMethod> attribute.

  • D. Configure FirstService using the <WebService> attribute.

A2:

Answer C is correct. The FirstService method must be marked using the <WebMethod> attribute in order to expose it within the Web service. Answers A and B are incorrect because the exposure of methods is not performed at the file or class level. Answer D is incorrect because the <WebService> attribute is used to mark an exposed class.

Question 3

You are building a Web service and wish to test its functionality while it is still under development. Which of these methods will let you most quickly test the Web service?

  • A. Build a Windows forms client application for the Web service.

  • B. Build an ASP.NET client application for the Web service.

  • C. Run the Web service in debug mode.

  • D. Add a Windows form directly to the Web service project.

A3:

Answer C is correct. It is possible to test a Web service by selecting Run within the Visual Studio interface to display the test page for the Web service within a browser window. This test page lets you test the functionality of the Web service without building any client application. Answers A, B, and D are all incorrect.

Question 4

Which of the following are valid transport protocols for translated XML messages? [Select all that apply.]

  • A. FTP

  • B. HTTP

  • C. SOAP

  • D. SMTP

A4:

Answers A, B, and D are correct. SOAP-translated XML messages may be transported using the FTP, HTTP, and SMTP, protocols. Answer C is incorrect because SOAP is used to encapsulate objects into XML format but does not provide a transport mechanism.

Question 5

You have created an application with Visual Studio .NET. The application is used by the accounting office that includes a Web Reference to the QuarterlyBalance Web service. Changes to this service have been made, and you need to reflect those changes in the proper proxy classes. What must you do?

  • A. Create a new application and add a new Web Reference to the Web service.

  • B. Delete the existing Web Reference and re-create it.

  • C. Update the Web Reference in the existing application.

  • D. Explicitly re-create the Web Reference using the wsdl.exe utility.

A5:

Answer C is correct. All you need to do is update the Web Reference within the existing application. Answers A and B are incorrect because it is not necessary to delete or create anything new simply to update an existing Web Reference. Answer D is incorrect because the original Web Reference was created in Visual Studio and therefore should be updated in that environment rather than at the command line.

Question 6

Due to problems with network connectivity between a remote office and the home site, you want to use an asynchronous transport mechanism to allow remote users to utilize a Web service. How should you implement code to fulfill this requirement?

  • A. Add entries to the web.config file for the Web service to enable the use of SMTP as a transport.

  • B. Modify the Web service server to store response messages and to return them only when explicitly queried by the client application.

  • C. Modify the Web service client application to use SMTP rather than HTTP as its transport mechanism.

  • D. Modify the Web service client application to call the asynchronous versions of the Web service method.

A6:

Answer D is correct. When you use Visual Studio .NET to create a Web service proxy in a client application, it automatically creates asynchronous wrappers for the Web methods in the Web service. If you call these wrappers, your client will communicate with the Web service asynchronously, without making any changes to the Web service. Answers A, B, and C are all incorrect.

Question 7

You want to create a Visual Basic .NET proxy class named MyService.vb from the WSDL file named NewService.wsdl . After navigating to the proper folder using the Visual Studio .NET Command Line utility, what code should you enter?

  • A. disco /language:VB /out:MyService.vb NewService.wsdl

  • B. disco /language:CS /out:MyService.vb NewService.wsdl

  • C. wsdl /language:CS /out:MyService.vb NewService.wsdl

  • D. wsdl /language:VB /out:MyService.vb NewService.wsdl

  • E. wsdl /language:VB /out:NewService.wsdl MyService.vb

A7:

Answer D is correct. You should execute the wsdl.exe utility using the /language specification of VB for a Visual Basic .NET result as well as the /out specification of the MyService.vb target file. Answers A and B are incorrect because they both specify the use of the disco.exe utility, which is not used to create proxy classes directly. Answers B and C are incorrect because they both specify the /language option of CS, which is used to generate a C# result file. Answer E is incorrect because the target file specification of MyService.vb must directly follow the /out switch designation.

Question 8

You are modifying an application to include references to the Employees class of a Web service available within the organization's intranet. The application already includes an Employees class. Using the WSDL utility, which switch should you use to allow these two classes to coexist without any naming conflict?

  • A. /domain

  • B. /namespace

  • C. /out

  • D. /server

A8:

Answer B is correct. The /namespace switch allows for the specification of a namespace for the Employees proxy class that is different from the namespace used by the existing Employees class. This way, both classes can be specified uniquely. Answer A is incorrect because the /domain switch is used to specify the domain used for authentication on the Web server. Answer C is incorrect because the /out switch specifies the name of the output file. Answer D is incorrect because the /server switch specifies that the resultant class should be a server rather than a client object.

Question 9

You are invoking a Web service within your client application. This Web service returns the DataSet object, which is included in the System.Data namespace. Where should you place a reference to the namespace?

  • A. In the client application project only.

  • B. In the Web service project only.

  • C. In both the client application and Web service projects.

  • D. You do not need to specify the namespace reference in either project.

A9:

Answer C is correct. You must place a reference to the proper namespace in both projects in order to generate and access a DataSet object between the server and client applications. Answers A and B are both incorrect because they specify only one of the two requirements, whereas answer D fails to include either.

Question 10

You have data contained in an XML file that you would like to send to a Web service. Which protocol should you use to send this data?

  • A. UDDI

  • B. WSDL

  • C. SOAP

  • D. HTTP

A10:

Answer C is correct. SOAP encapsulation creates XML files that may be transferred using many different protocols and may be used between systems produced by many different vendors and is therefore ideal for sending data to a Web service. Answer A is incorrect because UDDI is a discovery protocol that does not transfer data to a Web service. Answer B is incorrect because WSDL is a description of the Web service's interface, not a way to send data to the Web service. Answer D is incorrect because HTTP is a transport protocol that does not in itself wrap data for a Web service.



Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 188

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net