PrepAway - Latest Free Exam Questions & Answers

What should you do?

A file named Util.asmx contains the following code segment.

(Line numbers are included for reference only.)
01 <%@ WebService Language=”C#” class=”Exam.Util” %>
02 namespace Exam {
03 public class Util {
04 public string GetData() {
05 return “data”;
06 }
07 }
08 }

You need to expose the GetData method through a Web service.

What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Insert the following line of code between lines 02 and 03.
[System.Web.Services.WebService()]

B.
Replace line 03 with the following line of code.
public class Util : System.Web.Services.WebService

C.
Insert the following line of code between lines 03 and 04.
[System.Web.Services.WebMethod()]

D.
Replace line 01 with the following line of code.
<%@ WebService Language=”C#” class=”System.Web.Services.WebService” %>


Leave a Reply