单项选择题
You are developing a Windows Communication Foundation (WCF) service. The service operation takes a customer number as the only argument and returns information about the customer. The service requires a security token in the header of the message. You need to create a message contract for the service.
Which code segment should you use?()
A.
B.
C.
D.
相关考题
-
单项选择题
You are developing a client application that consumes a Windows Communication Foundation (WCF) service. You use the svcutil.exe utility to create a proxy for the service. You use the svcutil.exe switches that generate asynchronous calls. GetFlight is a service operation that takes no parameters and returns a string. The GetFlightCallback method must be called when the service operation returns.You create an instance of the client proxy with the following code:var client = new TranvelServiceClient();You need to ensure that a callback is received when the GetFlight operation is called asynchronously. Which code segment should you use?()
A. client.BeginGetFlight(GetFlightCallback, null); client.GetFlight();
B. client.GetFlight(); client.BeginGetFlight(GetFlightCallback, null);
C. client.GetFlightCompleted += new EventHandler(GetFlightCallback); client.GetFlightAsync();
D. IAsyncResult asyncResult = client.BeginGetFlight(GetFlightCallback, client); client.EndGetFlight(asyncResult); -
单项选择题
You are developing a client application that uses the following code to consume a Windows Communication Foundation (WCF) service.(Line numbers are included for reference only.) 01 BasicHttpBinding myBinding = new BasicHttpBinding(); 02 EndpointAddress myEndpointAddress = new EndpointAddress("http://contoso.com/TaxService.svc"); 03 ... 04 ITaxService client = channelFactory.CreateChannel(); 05 string data = client.GetData(1); You need to consume the service. Which code segment should you insert at line 03?()
A. var channelFactory = new ChannelFactory
();
B. var channelFactory = new ChannelFactory(myBinding);
C. var channelFactory = new ChannelFactory(myBinding, myEndpointAddress);
D. var channelFactory = new ChannelFactory("http://contoso.com/TaxService.svc"); -
单项选择题
You are creating a Windows Communication Foundation (WCF) service. The service endpoints change frequently. On the service, you add a new ServiceDiscoveryBehavior to the Behaviors collection of the ServiceHost Description property. You need to ensure that client applications can communicate with the service and discover changes to the service endpoints. What should you do?()
A. Add a new ServiceDiscoveryBehavior to the Behaviors collection in the client application.
B. Add a new AnnouncementClient to the Behaviors collection in the client application.
C. Use the FindCriteria class and the UdpDiscoveryEndpoint class to set up the binding in the client application.
D. Use the DiscoveryProxy class and the EndpointDiscoveryMetadata class to set up the binding in the client application.
