What should you do?

You work as the Microsoft.NET developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003. Domain.com operates as a financial information services provider to a number of financial institutions, i.e.
banks.
You are currently developing an application that will allow interaction with the financial institutions. All these banks expose a Web service that conforms to a standard Web Services Description Language (WSDL) document. However there are some of these banks that do not support a SOAP head that will allow Domain.com to pass transaction information to the Web services. To this end you make use of Microsoft Visual Studio 2005 to generate a Web proxy service named FinancialService. The exhibit below illustrates the clss that also gets generated.

public class Transaction : SoapHeader
{
public int TransactionID;
public string TransactionState;
}

You then proceed to write the following code so as to initiate the proxy class:
01 FinancialService financialServiceProxy = new FinancialService() ;
02 financialServiceProxy.TransactionValue = New Transaction () ;
03 financialService Proxy.TransactionValue.TransactionID = 1000 ;
04 financialService Proxy.TransactionValue.MustUnderstand = true;

However, after you have written this code you discover that the financial institutions that do support SOAP heads; throw exceptions of type SoapHeaderException when the Web methods are invoked. You thus need to modify the code to prevent these exceptions from being thrown. What should you do? (Choose the line number that represents the code statement that should be modified.)

You work as the Microsoft.NET developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003. Domain.com operates as a financial information services provider to a number of financial institutions, i.e.
banks.
You are currently developing an application that will allow interaction with the financial institutions. All these banks expose a Web service that conforms to a standard Web Services Description Language (WSDL) document. However there are some of these banks that do not support a SOAP head that will allow Domain.com to pass transaction information to the Web services. To this end you make use of Microsoft Visual Studio 2005 to generate a Web proxy service named FinancialService. The exhibit below illustrates the clss that also gets generated.

public class Transaction : SoapHeader
{
public int TransactionID;
public string TransactionState;
}

You then proceed to write the following code so as to initiate the proxy class:
01 FinancialService financialServiceProxy = new FinancialService() ;
02 financialServiceProxy.TransactionValue = New Transaction () ;
03 financialService Proxy.TransactionValue.TransactionID = 1000 ;
04 financialService Proxy.TransactionValue.MustUnderstand = true;

However, after you have written this code you discover that the financial institutions that do support SOAP heads; throw exceptions of type SoapHeaderException when the Web methods are invoked. You thus need to modify the code to prevent these exceptions from being thrown. What should you do? (Choose the line number that represents the code statement that should be modified.)

A.
01

B.
02

C.
03

D.
04

Explanation:
Line 04 should be changed. More specifically the MustUnderstand property of the Transaction class should be changed to false. When set to true, the Web method is invoked must understand the header represented by that class. Else the Web method throws an exception of SoapHeaderException. Because not all the financial institutions support SOAP headers, you should not force the Web services to understand the header.
Incorrect answers:
A, B, C: None of these line statements will cause an exception of type SoapHeaderException to be thrown.

VB, Creating, Configuring, and Deploying Remoting Applications (8 Questions)



Leave a Reply 0

Your email address will not be published. Required fields are marked *