A Windows Communication Foundation (WCF) service implements the following contract. [ServiceContract] public interface IHelloService { [OperationContract(WebGet(UriTemplate="hello?name={name}"))]A.B.C.D.

题目
A Windows Communication Foundation (WCF) service implements the following contract. [ServiceContract] public interface IHelloService { [OperationContract(WebGet(UriTemplate="hello?name={name}"))]

A.

B.

C.

D.


相似考题

2.A Windows Communication Foundation (WCF) solution uses the following contracts. (Line numbers are included for reference only.)01 [ServiceContract(CallbackContract=typeof(INameService))]02 public interface IGreetingService03 {04 [OperationContract]05 string GetMessage();06 }07 [ServiceContract]08 public interface INameService09 {10 [OperationContract]11 string GetName();12 }The code that implements the IGreetingService interface is as follows:20 public class GreetingService : IGreetingService21{22 public string GetMessage()23 {24 INameService clientChannel = OperationContext.Current.GetCallbackChannel();25 string clientName = clientChannel.GetName();26 return String.Format("Hello {0}", clientName);27 }28 }The service is self-hosted. The hosting code is as follows:30 ServiceHost host = new ServiceHost(typeof(GreetingService));31 NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);32 host.AddServiceEndpoint("MyApplication.IGreetingService", binding, "net.tcp//localhost:12345");33 host.Open();The code that implements the lNameService interface is as follows:40 class NameService : INameService41 {42 string name;43 public NameService(string name)44 {45 this.name = name;46 }47 public string GetName()48 {49 return name;50 }51 }Currently, this code fails at runtime, and an InvalidOperationException is thrown at line 25. You need to correct the code so that the call from the service back to the client completes successfully. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)()

参考答案和解析
参考答案:B
更多“A Windows Communication Foundation (WCF) service implements the following contract. [ServiceContract] public interface IHelloService { [OperationContract(WebGet(UriTemplate="hello?name={name}"))] ”相关问题
  • 第1题:

    You are creating a Windows Communication Foundation (WCF) service that implements the following service contract.[ServiceContract]public interface IOrderProcessing { [OperationContract] void ApproveOrder(int id);}You need to ensure that only users with the Manager role can call the ApproveOrder method. What should you do?()

    A. In the method body, check the Rights PosessesProperty property to see if it contains Manager

    B. Add a PrincipalPermission attribute to the method and set the Roles property to Manager

    C. Add a SecurityPermission attribute to the method and set the SecurityAction to Demand

    D. In the method body, create a new instance of WindowsClaimSet. Use the FindClaims method to locate a claimType named Role with a right named Manager


    参考答案:B

  • 第2题:

    A Windows Communication Foundation (WCF) solution exposes the following contract over an HTTP connection.[ServiceContract]public interface IDataService{ [OperationContract] string GetData();}Existing clients are making blocking calls to GetData. Calls to GetData take five seconds to complete.You need to allow new clients to issue non-blocking calls to get the data, without breaking any existing clients. What should you do?()

    A.

    B.

    C.Generate a proxy class with asynchronous methods and use it for the new clients

    D. Add a new endpoint to the service that uses a full-duplex binding and use it for the new clients.


    参考答案:C

  • 第3题:

    假设从键盘输入字符串Smith,以下程序的运行结果是()。 name=input() print("Hello,%s!"%name)

    A.Hello,%s!

    B.Hello,name!

    C.Hello,Smith

    D.Hello,Smith!


    str[i++] 32。 while语句的循环控制条件既要将相应元素赋予从键盘输入的字符,又要改变元素的下标值,以便接受下一个字符,可用下标变量的后置加实现;小写字母的ASCII码值比相对应的大写形式大32。

  • 第4题:

    You are consuming a Windows Communication Foundation (WCF) service in an ASP. NET Web application.The service interface is defined as follows:[ServiceContract]public interface ICatalog{ [OperationContract] [WebGet(UriTemplate="/Catalog/Items/{id}", ResponseFormat=WebMessageFormat.Json)] string RetrieveItemDescription(int id); } The service is hosted at Catalogsvc.You need to call the service using jQuery to retrieve the description of an item as indicated by a variable named itemId. Which code segment should you use?()

    A. $get(String.format("/Catalogsvc/Catalog/Items/id{0}", itemId) null, function (data) { ... }, javascript");

    B. $get(String.format("/Catalogsvc/Catalog/Items/{0}", itemId), null, function (data) { ... }, "json");

    C. $get(String.format("/Catalogsvc/Catalog/Items/{0}", itemld), null, function (data) { ... }, "xml");

    D. $get(String.format("/Catalogsvc/Catalog/Items/id{0}", itemld), null, function (data) { ... }, "json");


    参考答案:B

  • 第5题:

    A Windows Communication Foundation (WCF) service uses the following service contract. [ServiceContract] public interface IService{ [OperationContract] string Operation1(string s);}You need to ensure that the operation contract Operation1 responds to HTTP POST requests.Which code segment should you use?()

    A.

    B.

    C.

    D.


    参考答案:A