Windows Communication Foundation (WCF) Flashcards
7 cards from real MCTS practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Windows Communication Foundation (WCF) flashcards as text
In WCF, which security mode encrypts and signs the message payload, protecting it regardless of transport-level security?
Answer: Message
Message security mode encrypts and signs the SOAP message itself using WS-Security, providing end-to-end protection independent of the transport channel.
What is the purpose of the [DataContract] and [DataMember] attributes in WCF?
Answer: To mark a class and its fields/properties for serialization across service boundaries
[DataContract] marks a type as serializable by the DataContractSerializer, and [DataMember] marks the specific fields or properties to include in serialization.
Which WCF communication pattern allows the service to call back to the client, requiring the client to implement a callback contract?
Answer: Duplex
Duplex communication allows the service to initiate calls to the client through a callback channel, which the client must implement as a separate contract.
What does the ChannelFactory class provide in WCF client-side programming?
Answer: It creates typed client channel objects without requiring a generated proxy class
ChannelFactory allows you to create a channel to a service using a known contract interface, avoiding the need for a generated client proxy class.
Which WCF binding is best suited for REST/JSON services consumed by web browsers or mobile clients?
Answer: WebHttpBinding
WebHttpBinding configures WCF for RESTful services using HTTP GET/POST with JSON or XML, without SOAP envelopes, suitable for browser and mobile clients.
What is the role of an IServiceBehavior implementation in WCF?
Answer: It customizes or extends the runtime behavior of the entire service
IServiceBehavior allows you to inspect, modify, or extend WCF service runtime behavior such as adding inspectors, validators, or custom throttling.
Which InstanceContextMode value causes WCF to create a new service instance for every incoming message?
Answer: PerCall
InstanceContextMode.PerCall creates a new service object for each incoming operation call, ensuring stateless, scalable request processing.