PrepAway - Latest Free Exam Questions & Answers

You need to ensure that the GetCurrentRate method can be called from JavaScript

You are implementing a WCF service library. You add a new code file that contains the following
code segment.
Namespace ContosoWCF
<ServiceContract()>
Public Interface IRateService
<OperationContract()>
Function GetCurrentRate() As Decimal
End Interface
Partial Public Class RateService
Implements IRateService
Public Function GetCurrentRate() As Decimal _
Implements IRateService.GetCurrentRate
Dim currentRate As Decimal =
GetRateFromDatabase()
Return currentRate
End Function
End Class
End Namespace

You build the service library and deploy its assembly to an IIS application. You need to ensure that
the GetCurrentRate method can be called from JavaScript. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Add a file named Service.svc to the IIS application. Add the following code segment to the file.
<%@ ServiceHost Service=”ContosoWCF.IRateService”
Factory=”System.ServiceModel.Activation.WebScriptServiceHostFactory”
%>

B.
Add a file named Service.svc to the IIS application. Add the following code segment to the file.
<%@ ServiceHost Service=”ContosoWCF.RateService”
Factory=”System.ServiceModel.Activation.WebScriptServiceHostFactory”
%>

C.
Apply the ScriptService attribute to the RateService class. Rebuild the WCF service library, and
redeploy the assembly to the IIS application.

D.
Apply the WebGet attribute to the GetCurrentRate interface method. Rebuild the WCF service
library, and redeploy the assembly to the IIS application.


Leave a Reply