What should you do?
A. Add this attribute to the GetServiceTime method. [Weblnvoke(MetMode”POST”)] In the web.config file, add this element to system.serviceModel/behaviors/endpointBehaviors. <behavior namee”Json”> <enableWebScript /> </behavior> In the web.config file, configure TestService in the system.serviceModel/services collection as follows <service namez”TestService”> <endpoint address”/ServiceTime” contracts”TestService” behaviorConfiguration=”Json” bindingz”webHttpBinding” /> </service>
B. Add this attribute to the GetServiceTime method. [WebInvoke(Method = “GET’, UriTemplate “/ServiceTime”, ResponseFormat = WebMessageFormat.Json)] In the web.config file, configure TestService in the system.serviceModel/services collection as follows. <service namez”TestService”> <endpoint address=”/ServiceTime” contract=”TestService” bindinge”webHttpBinding” /> </service>
C. Add this attribute to the GetServiceTime method [WebGet( ResponseFormat= WebMessageFormat.Json, UriTemplatee=”/ServiceTime”)] Create a new svc file named JsonVersion.svc with the following content. <%@ ServiceHost Service”TestService’ Factorye=”System.ServiceMode.ActivationWebServiceHostFactory” %>
D. Add this attribute to the GetServiceTime method. [WebGet(UriTemplate = (Uson)/ServiceTime”)] Create a new .svc file named Jsonversion svc with the following content <%@ ServiceHost Servicee”TestService” Factory=”System ServiceModel.ActivationWebServiceHostFactory” %>
Answer:C
What should you do?
A. Add this attribute to the GetServiceTime method. [Weblnvoke(MetMode”POST”)] In the web.config file, add this element to system.serviceModel/behaviors/endpointBehaviors. <behavior namee”Json”> <enableWebScript /> </behavior> In the web.config file, configure TestService in the system.serviceModel/services collection as follows <service namez”TestService”> <endpoint address”/ServiceTime” contracts”TestService” behaviorConfiguration=”Json” bindingz”webHttpBinding” /> </service> B. Add this attribute to the GetServiceTime method. [WebInvoke(Method = “GET’, UriTemplate “/ServiceTime”, ResponseFormat = WebMessageFormat.Json)] In the web.config file, configure TestService in the system.serviceModel/services collection as follows. <service namez”TestService”> <endpoint address=”/ServiceTime” contract=”TestService” bindinge”webHttpBinding” /> </service> C. Add this attribute to the GetServiceTime method [WebGet( ResponseFormat= WebMessageFormat.Json, UriTemplatee=”/ServiceTime”)] Create a new svc file named JsonVersion.svc with the following content. <%@ ServiceHost Service”TestService’ Factorye=”System.ServiceMode.ActivationWebServiceHostFactory” %> D. Add this attribute to the GetServiceTime method. [WebGet(UriTemplate = (Uson)/ServiceTime”)] Create a new .svc file named Jsonversion svc with the following content <%@ ServiceHost Servicee”TestService” Factory=”System ServiceModel.ActivationWebServiceHostFactory” %>