A self-hosted Windows Communication Foundation (WCF) service uses a secure HTTP binding with a custom principal permission mode. The binding requires users to provide their Windows logon credentials. You need to retrieve the identity of the caller.What are two possible properties you can use to achieve this goal? (Each correct answer presents a complete solution Choose two)()
A. Thread.CurrentPrincipal.Identity.Name
B. HttpContext.Current.User.Identity.Name
C. ServiceSecurityContext.Current.PrimaryIdentity.Name
D. OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name
第1题:
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.
第2题:
A.
B.
C.
D.
第3题:
A. Set the authorization Manager Type attribute of the service Authorization behavior to Message.
B. Set the include Exception Detailsln Faults attribute of the service Debug behavior to true.
C. Set the Mode attribute of the security configuration element to Message.
D. Set the message Authentication AuditLevel attribute of the service Security Audit behavior to Failure.
第4题:
A. NetTcpContextBinding
B. BasicHttpContextBinding
C. NetTcpBinding
D. NetMsmqBinding
第5题:
A Windows Communication Foundation (WCF) solution provides a session-based counter.The service is self-hosted. The hosting code is as follows:ServiceHost host = new ServiceHost(typeof(CounterService));NetTcpBinding binding1 = new NetTcpBinding(SecurityMode.None);host.AddServiceEndpoint("MyApplication.ICounterService", binding1, "net.tcp://localhost:23456");host.Open();This service is currently exposed over TCP, but needs to be exposed to external clients over HTTP. Therefore, a new service endpoint is created with the following code:host.AddServiceEndpoint("MyApplication.ICounterService", binding2, "http://localhost:12345");You need to complete the implementation and ensure that the session-based counter will perform over HTTP as it does over TCP.What should you do?()
A.
B.
C.
D.
第6题:
You are developing a data contract for a Windows Communication Foundation (WCF) service. The data in the data contract must participate in round trips. Strict schema validity is not required. You need to ensure that the contract is forward-compatible and allows new data members to be added to it. Which interface should you implement in the data contract class?()
A.ICommunicationObject
B.IExtension
C.IExtensibleObject
D.IExtensibleDataObject