单项选择题
You are developing a Windows Comunication Foundation (WCF) service that is used to check the status of orders placed by customers.The following code segment is part of your service.(Line numbers are included for reference only.)
01 [ServiceContract]
02 public interface IStatus
03 {
04 [OperationContract]
05 int GetOrderStatus(string orderNumber);
06 }
07
08 class OrderService : IStatus
09 {
10 public int GetOrderStatus(string orderNumber)
11 {
12 ...
13 }
14 }
15
16 class Program
17 {
18 static void Main(string[] args)
19 {
20
21
22 host.Open();
23 ...
24 }
25 }You need to ensure that the service always listens at net.pipe://SupplyChainServer/Pipe.
What should you do?()
A.
B.
C.
D.
相关考题
-
单项选择题
You develop a Windows Communication Foundation (WCF) service. It is used exclusively as an intranet application and is currently unsecured. You need to ensure that the service meets the following requirements: The service now must be exposed as an Internet application. The service must be secured at the transport level. Impersonation and delegation cannot be enabled. What should you use? ()
A. basicHttpBinding and HTTP
B. basicHttpBinding and Kerberos
C. wsHttpBinding and Kerberos
D. wsHttpBinding and HTTPS -
单项选择题
You are creating an application using Visual Studio 2010. The application consumes a Windows Communication Foundation (WCF) service.You are adding a service reference to the WCF service. You need to ensure that the generated proxy does not block the calling thread when executing a service method. What should you do when adding the service reference? ()
A. Set the Collection type to ObservableCollection.
B. Select the Reuse types in all referenced assemblies option.
C. Select the Generate asynchronous operations option.
D. Select the Always generate message contracts option. -
单项选择题
You are developing a Windows Communication Foundation (WCF) REST service to provide access to a library book catalog. The following code segment defines the service contract. (Line numbers are included for reference only.) 01 [ServiceContract()] 02 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 03 public Class LibraryService 04 { 05 public Book GetBookByTitle(string title) 06 { 07 ... 08 } 09 10 [WebGet(UriTemplate = "Book/{id}")] 11 public Book GetBookById(string id) 12 { 13 ... 14 } 15 }Library patrons want the ability to search the catalog by title.You need to ensure that the GetBookByTitle method is exposed as a service method.Which code segment should you insert at line 04?()
A. [WebGet(UriTemplate = "Book/{title}")]
B. [WebGet(UriTemplate = "BookByTitle/{title}")]
C. [WebGet(UriTemplate = "Book/{titleToSearch}")]
D. [WebGet(UriTemplate = "{titleToSearch}")]
