单项选择题
A Windows Communication Foundation (WCF) service implements a contract with one-way and request-reply operations.The service is exposed over a TCP transport. Clients use a router to communicate with the service. The router is implemented as follows. (Line numbers are included for reference only.)
01 ServiceHost host = new ServiceHost(typeof(RoutingService));
02 host.AddServiceEndpoint(
03 typeof(ISimplexDatagramRouter),
04 new NetTcpBinding(), "net.tcp://localhost/Router"
05 );
06 List
07 lep.Add(
08 new ServiceEndpoint(
09 ContractDescription.GetContract(
10 typeof(ISimplexDatagramRouter)
11 ),
12 new NetTcpBinding(),
13 new EndpointAddress("net.tcp://localhost:8080/Logger")
14 )
15 );
16 RoutingConfiguration rc = new RoutingConfiguration();
17 rc.FilterTable.Add(new MatchAllMessageFilter(), lep);
18 host.Description.Behaviors.Add(new RoutingBehavior(rc));Request-reply operations are failing.
You need to ensure that the router can handle one-way and request-reply operations.What should you do?()
A. Change line 03 as follows: typeof(IRequestReplyRouter),
B. Change line 03 as follows: typeof(IDuplexSessionRouter),
C. Change line 10 as follows: typeof(IRequestReplyRouter)
D. Change line 10 as follows: typeof(IDuplexSessionRouter)
相关考题
-
单项选择题
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. -
单项选择题
You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner. You need to add a delete operation. You implement the delete method as follows:void DeleteItems(string id);You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation. What should you do?()
A. Add the WebInvoke(UriTemplate="/Items/{id}", Method="DELETE") attribute to the operation
B. Add the HttpDelete atribute to the operation
C. Replace the string parameter with a RemovedActivityAction parameter
D. Replace the return type with RemovedActivityAction. -
单项选择题
You are developing a client that sends several types of SOAP messages to a Windows Communication Foundation (WCF) service method named PostData. PostData is currently defined as follows:[OperationContract]void PostData(Order data);You need to modify PostData so that it can receive any SOAP message. Which code segment should you use?()
A. [OperationContract(IsOneWay=true, Action="*", ReplyAction="*")] void PostData(Order data);
B. [OperationContract(IsOneWay=true, Action="*", ReplyAction = "*")] void PostData(BodyWriter data);
C. [OperationContract] void PostData(BodyWriter data);
D. [OperationContract] void PostData(Message data);
