Implementing asynchronous calls and remoting events

These questions are based on Cert-70-554VB – MSCert: UPGRADE – MCSD Microsoft .NET Skills to MCPD Enterprise Application Developer Using the Microsoft .NET Framework: Part 2 – Section 1 Microsoft Developer Self-Test Software Practice Test.

Objective: Implementing asynchronous calls and remoting events
SubObjective: Call Web methods asynchronously

Item Number: Cert-70-554VB.4.1.1
Single Answer, Multiple Choice

You are an enterprise application developer at AccuTech Corp. You are developing an ASP.NET 2.0 Web application for customers to renew their existing insurance policies. The Web application consumes a Web service named InsuranceSolutionService.

The InsuranceSolutionService Web service is defined as follows:

Public Class InsuranceSolutionService
  Inherits WebService
                <WebMethod()> _
                Public Function RenewPolicy(ByVal number As Integer, _
                  ByVal amount As Single, ByVal duration As Integer) As Boolean
                                ‘Implementation code
                End Function
End Class

One of the Web pages, RenewPolicy.aspx, has a button for customers to renew their existing policies. When a user clicks the RenewPolicyButton Web control in the client Web application, the RenewPolicy method should be invoked before displaying the next Web page to the user. You enable the asynchronous operations on the page.

The RenewPolicy method takes a significant amount of time to complete execution. While the RenewPolicy method is executing, the user should be taken to the next page in the Web application. Which code should you use to invoke the RenewPolicy Web method?

  1. Protected Sub RenewPolicyButton_Click(ByVal sender As Object, ByVal e As EventArgs)
                    Dim proxy As New InsuranceSolutionService()
                    proxy.RenewPolicy(policyNumber, amount, 365)
    End Sub

  2. Protected…



Posted in Uncategorized|


Powered by WebDesk