PrepAway - Latest Free Exam Questions & Answers

What should you do?

You call a method in a Web service.
The following exception is thrown in the Web service client.

System.Web.Services.Protocols.SoapException: Server was unable toprocess request. –> System.NullReferenceException: Object reference not set to an instance of an object.

You discover that it is the following line of code that throws the exception.

if (Session [“StoredValue”] == null)

You need to ensure that the method runs without throwing the exception. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Modify the WebMethod attribute in the Web service so that the EnableSession property is set to True.

B.
In the client code for the Web service’s proxy object, assign a new instance of the System.Net.CookieContainer object to the CookieContainer property.

C.
Add the following element to the System.Web section of the Web.config file.
<sessionState mode=”InProc”/>

D.
Add the following elements to the System.Web section of the Web.config file.
<httpModules>
<add name=”Session” type=”System.Web.SessionState.SessionStateModule” />
</httpModules>


Leave a Reply