Question:You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You create an ASMX Web service in the application by using the following code segment.
[WebService(Namespace = "http://geo.service.org/")] public class GeographyService : System.Web.Services.WebService {
public GeographyService () {
}
[WebMethod]
public string GetCapitalCity(string szCountryName) {
string city = string.Empty;
//query db to get city name
//... return city; }
}
You need to ensure that the ASMX Web service can be accessed from the client script by using ASP.NET AJAX.
Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.)
A Add a ScriptReference element to the ScriptManager element in the following manner.
<asp:ScriptManager runat="server" ID="scriptManager">
<Scripts> <asp:ScriptReference Path="~/GeographyService.asmx" />
</Scripts> </asp:ScriptManager>
B Decorate the GeographyService class by using the [System.Web.Script.Services.ScriptService] attribute
C Add a ServiceReference element to the ScriptManager element in the following manner.
<asp:ScriptManager runat="server" ID="scriptManager">
<Services>
<asp:ServiceReference path="~/GeographyService.asmx" />
</Services>
</asp:ScriptManager>
D Add the following XML fragment to the Web.config file of the Web application.
<system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" type="System.Web.Handlers.ScriptResourceHandler" validate="false"/>
</httpHandlers>
<system.web>
E Add the following XML fragment to the Web.config file of the Web application.
<system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory" validate="false"/>
</httpHandlers>
<system.web>
F Decorate the GetCapitalCity method by using the [System.Web.Script.Services.ScriptMethod] attribute.