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 followingcode segment.
namespace ContosoWCF
{
[ServiceContract]
public interface IRateService
{
[OperationContract]
decimal GetCurrentRate();
}
public partial class RateService : IRateService
{
public decimal GetCurrentRate()
{
decimal currentRate = GetRateFromDatabase();
return currentRate;
}
}
}
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 script service attribute to rate sericeclass Rebulid the WCF servicelibrary, and redploy the
assembly to the IIS application.

D.
Apply the Web get attibute to the Get Currant rate interface Method.Rebuild the WCF servicelibrary, and
redploy the assembly to the IIS application.


Leave a Reply