Exam Prep Questions

Question 1

You have used the Web Services Discovery tool to retrieve information about a Web service named ZipcodeService . Which file would contain the URL for any documentation of the ZipcodeService Web service?

  • A. disco.exe

  • B. results.discomap

  • C. ZipcodeService.wsdl

  • D. ZipcodeService.disco

A1:

Answer D is correct. The .disco file is the only one that contains documentation URLs. Answer A is incorrect because disco.exe is the Web services discovery tool that discovers the URLs of XML Web services. Answers B and C are incorrect because the .discomap and .wsdl files are XML files that do not contain any documentation URLs.

Question 2

You have created a Web service to return financial information using ASP.NET. One of the methods in your Web service is defined with this code:

 public double Cash() {     // Calculations omitted } 

Potential consumers of your Web service report that, although they can set a reference to the Web Service, the Cash() method is not available. What could be the problem?

  • A. The .asmx file for the Web service is not available on your Web server.

  • B. The Web service class is not marked with the [WebService] attribute.

  • C. The Cash() method is not marked with the [WebMethod] attribute.

  • D. Web service methods can return only string values.

A2:

Answer C is correct. All exposed methods of a Web service must be marked with the [WebMethod] attribute. Answer A is incorrect because consumers of the Web service can set a reference to the Web service and the .asmx file must be available on the server. Answer B is incorrect because the [WebService] attribute is used only to set a namespace for the Web service. Answer D is incorrect because Web service methods can be of any serializable type, including string and double .

Question 3

Your application invokes a Web service named Northwind that includes a Web method named GetOrders(). GetOrders() returns a DataSet object containing order information. What must you do to use this DataSet object in your client application?

  • A. Create a new DataSet object and use the ReadXml() method of DataSet to initialize it from the returning SOAP message.

  • B. Obtain an XSD file that specifies the schema of the DataSet object. Then use this XSD file to instantiate a DataSet object from the returned data from the GetOrders() method.

  • C. Assign the return value from the GetOrders() method to an array of DataRow variables . Then loop through the array to build the DataSet object.

  • D. Assign the return value from the GetOrders() method to a DataSet variable.

A3:

Answer D is correct. The only thing you need to do to use a complex variable returned by the Web service is to declare an instance of the same data type in the client application. Answers A and B are incorrect because they involve additional efforts. Answer C is incorrect because a DataSet object cannot be mapped to an array of DataRow objects.

Question 4

You are using the Web Services Description Language tool to create a proxy class for a Web service. The Web service exposes a class named Customer , but you already have a Customer class in your application. What is the best way to allow both classes to coexist in the same application?

  • A. Use the /namespace option of the Web Services Description Language tool to specify a unique namespace for the new class.

  • B. Rename the existing class.

  • C. Use the /out option of the Web Services Description Language tool to specify a unique output filename for the new class.

  • D. Manually edit the generated proxy class to change the class name it contains.

Answer A is correct. Specifying a unique namespace for the new object eliminates the possibility that it could clash with a preexisting object name. Answer B is incorrect because renaming a class can break other applications that depend on it. Answer C is incorrect because the /out option of the WSDL tool specifies only the file in which to save the generated proxy code and doing so does not help in the coexistence of the given classes. Answer D is incorrect because it requires additional coding efforts.

Question 5

You want to use a Web service that supplies inventory-level information in your application. You know the URL of the .asmx file published by the Web service. Which step should you take first?

  • A. Open the .asmx file in a Web browser.

  • B. Run the XML Schema Definition tool.

  • C. Run the Web Services Discovery tool.

  • D. Copy the .asmx file to your client project.

A5:

Answer C is correct. The Web Services Discovery tool retrieves copies of the files you need to proceed with this project. Answer A is incorrect because opening the .asmx file in the Web browser will not help you create client projects to invoke the Web service. Answer B is incorrect because the XML Schema Definition tool will not help you locate WSDL and other files needed to invoke the Web service. Answer D is incorrect because you should not copy the .asmx file to the client project ”you might not always have access to the .asmx file.

Question 6

One of your business partners has informed you that he's making his inventory information available via a Web service. You do not know the URL of the Web service, so you want to discover the URL of the Web service with the least amount of effort. Which of the following actions should you take?

  • A. Use the Web Services Discovery tool to download the information.

  • B. Use the Web Services Description Language tool to create a proxy class.

  • C. Use a UDDI registry to locate the Web service.

  • D. Use a search engine to explore your partner's Web site.

A6:

Answer C is correct. UDDI registries exist so that you can find business services by browsing or searching. Answers A and B are incorrect because the Web Services Discovery tool requires you to know the URL of the WSDL contract file ( .wsdl ), the XSD schema file ( .xsd ), or the discovery document ( .disco ) of the Web service. Answer D is incorrect because typical search engines do not provide a direct facility for searching or browsing Web services and can require additional efforts to discover the URL of the Web service.

Question 7

Your application includes a Web reference to a Web service that delivers customer information as an object with multiple properties. The developer of the Web service has added a new property named CreditRating to the object. You want to use the CreditRating property in your code with the least amount of effort. Which of the following actions should you take?

  • A. Create an entirely new client application, and then add to the new application a Web reference for the Web service.

  • B. Delete and re-create the Web reference in the existing application.

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

  • D. Use a generic Object variable to hold customer information so that you can call any property you want.

A7:

Answer C is correct. The Update Web Reference menu item for a Web reference refreshes local configuration information from the server that hosts the Web service. Answers A, B, and D are incorrect because these actions require additional efforts to complete.

Question 8

Your application calls a Web service that performs complex, time-consuming calculations. Users complain that the user interface of the application freezes while it's recalculating. Which approach below is guaranteed to solve this problem?

  • A. Move the application to a faster computer.

  • B. Install a faster link to the Internet.

  • C. Install more memory in the computer.

  • D. Use asynchronous calls to invoke the Web service.

A8:

Answer D is correct. An asynchronous call to invoke the Web service returns the control to the user without waiting for the complete execution of the Web service. This approach of invoking Web services assists in making the user interface responsive . Answers A, B, and C are incorrect because speeding up the client computer does nothing to speed up the Web service, which runs on the server computer.



MCAD Developing and Implementing Web Applications with Visual C#. NET and Visual Studio. NET (Exam [... ]am 2)
MCAD Developing and Implementing Web Applications with Visual C#. NET and Visual Studio. NET (Exam [... ]am 2)
ISBN: 789729016
EAN: N/A
Year: 2005
Pages: 191

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