多项选择题
You are developing a Windows Communication Foundation (WCF) service that returns location information
for authorized law enforcement agencies. The service contract is as follows:
[ServiceContract]
public interface IMappingService
{
[OperationContract]
long[] GetLocationCoordinates(String cityName);
[OperationContract]
long[] GetLocationOfCitizen(String ssn);
}
Users are authenticated and impersonated. The system uses ASP.NET roles.
The members of law enforcement are members of the LawEnforcement role.
You need to ensure that only members of the LawEnforcement role can call these methods.
What are two possible ways to achieve this goal?() (Each correct answer presents a complete solution. Choose two.)
A. Add a PrincipalPermissionAttribute to each method that should be available only to members of law enforcement. Set its SecurityAction to Demand and set the role equal to LawEnforcement.
B. Use the CurrentPrincipal property of the thread. Call the IsInRole method specifying LawEnforcement as a parameter.
C. Create a GenericPrincipal specifying Thread.CurrentPrincipal.Identity as the IIdentityParameter and LawEnforcement as the only value for the Roles parameter.
D. At the beginning of each method, enumerate each ClaimSet in a new WindowsClaimSet. Use the FindClaims method to locate a claim type named Role with a right named LawEnforcement.
相关考题
-
单项选择题
You need to modify a client application that consumes a Windows Communication Foundation (WCF) service. The service metadata is no longer available. You need to modify the previously generated proxy to include asynchronous calls to the service. What should you do? ()
A. Update the service reference with the Generate asynchronous operations option.
B. Create a partial class for the previously generated proxy and include the new asynchronous methods.
C. Create a class with the same name as the previously generated proxy and add the new asynchronous methods. Add the new class to a namespace that is different from the original proxy.
D. Create a class with the same name as the previously generated proxy and add the new asynchronous methods as partial methods. Add the new class to a namespace that is different from the original proxy. -
单项选择题
following code segment. [ServiceContract] public interface ICustomerService { ... } public class CustomerService : ICustomerService { ... } The service is self-hosted in a console application. Older client applications access the service at http://contoso.com:8080/CustomerService/V1. Newer client applications access the service at http://contoso.com:8080/CustomerService/V2. You need to ensure that any client application can access the service at either address. Which code segment should you use?()
A.
B.
C.
D. -
单项选择题
You create a service and deploy it on a network in a building named Building1. You will deploy the service to Building2. The service in Building1 is configured using the following discovery scopes. The service in Building2 will be configured using the following discovery scopes. You need to ensure that the client application can discover the service in Building1 or the service in Building2. Which scopes should you add to the client configuration file? ()
A.
B.
C.
D.
