位置:首页 > 题库频道 > 其它分类 > 计算机其它 > 微软MCAD 70-310 实战百题

You create an XML Web service named PhoneNumberService that returns the telephone numbers of people in a specified geographical region. If an error occurs when the service is processing requests, a custom application exception named PhoneNumberException is thrown.You create an ASP. NET application named Your Phone Book that contains a Web reference to PhoneNumberService. You need to wrap any calls made to PhoneNumberService in a try/catch block to catch any PhoneNumberException that may be thrown.Which two code segments are possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)

发布时间:2021-12-25

A.Try'Code to call PhoneNumberService method goes here.Catch ex As SoapException 'Handle the exception.End Try

B.Try'Code to call PhoneNumberService method hoes here.Catch ex As SoapHeaderException 'Handle the exception.End Try

C.Try'Code to call PhoneNumberService method goes here.Catch ex As Exception 'Handle the exception.End Try

D.Try'Code to call PhoneNumberService method goes her

E.Catch ex As Application 'Handle the exception. End Try

试卷相关题目

  • 1You create a Windows service named FxListener that performs financial transactions by using files in a drop directory. When a new XML file appears in the drop directory, FxListener opens the file and performs the financial transaction contained within the XML code.You want updates to each XML file to be logged in the Windows application log. A String object named myMessage contains the message to be logged.Which code segment should you use?

    A.EventLog.WriteEntry("FxListener", myMessage)

    B.Dim log As New EventLog("Application") log.WriteEntry(myMessage)

    C.Dim log As New EventLog("Application")Trace•WriteLine(log, myMessage)

    D.Dim log As New EventLog("FxListener") log.Source = "Application"log.WriteEntry(myMessage, EventLogEntryTyp

    E.SuccessAudit)

    开始考试点击查看答案
  • 2You are creating an ASP.NET application named MyWebApp. To MyWebApp, you add a Web reference to an XML Web service named UserService. UserService consists of a Web method named RetrieveUserInfo. This Web method takes a userlD as input and returns a DataSet object containing user information. If the userlD is not between the values 1 and 1000, a System ArgumentException is thrown.In MyWebApp, you write a try/catch block to capture any exceptions that are thrown by UserService. You invoke RetrieveUserlnfo and pass 1001 as the userlD.Which type of exception will be caught?

    A.System.ApplicationExceptionB . System.ArgumentExceptionC . System.We

    B.Service.Protocols.SoapExceptionD. System.Web.Service.Protocols.SoapHeaderException

    开始考试点击查看答案
  • 3You are debugging a visual studio . Net application. The application produces an Xml documents object and then consumes the same object. This object moves data in the application. The object has no schema, but it contains a declaration line that you must inspect.You decide to transform the XML code and its declaration into a string for easy inspection.What should you do?

    A.Assign the ToString method of the Xml Document object to astring variable

    B.Assign the OuterXml property of the XmlDocument object to a string variable

    C.Assign the OuterXml property of the DocumentElement property of the XmlDocument object to a string variable

    D.Use the WriteContentTo method of the XmlDocument object to write the document into a MemoryStream object. Use the GetXml method of the DataSet object to get a string version of the document

    开始考试点击查看答案
  • 4You are preparing to deploy an XML Web service named InventoryService. This service queries a Microsoft SQL Server database and returns information to the caller.You use Visual Studio .NET to create a setup project. You need to install InventoryService. You also need to run a script to create the necessary SQL Server database and tables to store the dat

    A.To accomplish this, you need to configure the project to have administrator rights to the SQL Server database.You add a custom dialog box to the project that prompts the user for the administrator user name and password that are used to connect to the SQL Server database. You need to make the user name and password available to a custom Installer class that will execute the script.What should you do?A.Add a launch condition that passed the user name and password to the Install subroutine

    B.Add a merge module to the project that captures the user name and password. Use the merge module to access these values in the Install subroutine

    C.Retrieve the user name and password from the saved State objectin the Install subroutine

    D.Create a custom install action. Set the CustomActionData property to the entered user name and password. Then access these values in the Install subroutine

    开始考试点击查看答案
  • 5You are creating a .NET Remoting object named Payroll. The Payroll class allows remote client applications to access payroll data for your company. Client applications are developed by using Windows Forms and Web Forms.You must ensure that remote client applications are securely authenticated prior to gaining access to Payroll object. You want to accomplish this task by writing the minimum amount of code.What should you do?

    A.Use a TcpChannel and a Binary Format ter for the Payroll class

    B.Use an HttpChannel and a SoapFormatter for the Payroll class

    C.Host the Payroll class in Internet Information Services(IIS) and implement Basic authentication.

    D.Host the Payroll class in Internet Information Services(IIS) and implement Integrated Windows authentication

    开始考试点击查看答案
返回顶部