Which code segment should you insert at line 03?

You create a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
You write the following code segment. (Line numbers are included for reference only.)

01 public interface IMvService
02 {
03 …
04 string ProcessString(string name);
05 }

You create a host for the WCF service.
You also create a service endpoint at http://localhost:8080/service.
You add an instance of the HttpTransferEndPointBehavior class to the host.
You need to ensure that the ProcessString method can be invoked from a Web browser by using the URL http://localhost:8080/service/process?name=value.
Which code segment should you insert at line 03?

You create a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
You write the following code segment. (Line numbers are included for reference only.)

01 public interface IMvService
02 {
03 …
04 string ProcessString(string name);
05 }

You create a host for the WCF service.
You also create a service endpoint at http://localhost:8080/service.
You add an instance of the HttpTransferEndPointBehavior class to the host.
You need to ensure that the ProcessString method can be invoked from a Web browser by using the URL http://localhost:8080/service/process?name=value.
Which code segment should you insert at line 03?

A.
[OperationContract(Name="process", Action="Get")]

B.
[OperationContract(Name="process"_Action="Post")]

C.
[OperationContract][WebGet(UriTemplate= "process?name={name}")]

D.
[OperationContract][Weblnvoke(UriTemplate= "process?name={name}")]



Leave a Reply 0

Your email address will not be published. Required fields are marked *