Você está na página 1de 3

Introducing Windows Communication

Foundation
Chapter 10 to 15
14 August 2018 7:02 AM

Chapter 10 What are CreateSequence and


Implementing Reliable Sessions CreateSequenceResponse messages with
What is “replay attack” security in WCF WS-ReliableMessaging protocol?
 The first message in the protocol is this CreateSequence
messaging? message sent by the WCF runtime on the client
 The common security issue in WCF service and client computer.
communication is that a third party intercepts messages  This message initiates the reliable session.
and repeatedly forwards them on to the intended  And a CreateSequenceResponse message sent back to
destination. the client by the WCF runtime on the service computer
 This is known as “replay attack”.
In reliable messaging, how do a Service
What is meant by Reliable Sessions? acknowledge a client that its message has
 WCF reliable sessions is an implementation of SOAP
reliable messaging as defined by the WS-Reliable been received?
Messaging protocol. WCF SOAP reliable messaging  When the WCF runtime on the server computer receives
provides an end-to-end reliable session between two this message, it must send an acknowledgment message
endpoints, regardless of the number or type of back to the client computer so that the client knows it
intermediaries that separate the messaging endpoints. has been received.
What is the difference between reliable What is LatMessage with WS-
messaging and reliable session? ReliableMessaging protocol?
 Reliable messaging is concerned with ensuring that  The LatMessage is sent by the WCF runtime on the client
messages are delivered exactly once, and a reliable computer to indicate that this is the final message in the
session provides a context for sending and receiving a sequence .
series of reliable messages.  This message is sent when the client application starts to
close the session The WCF runtime on the server
What is the main objectives of reliable
computer acknowledges this message and then sends
messaging? its own LastMessage message to indicate that it has also
 The main objective is to handle the problems of lost finished.
messages, or messages arriving in the wrong order.
 Messages can pass through any number of intermediary
What is the disadvantage of Reliable
sites on the network to the destination. Messaging?
 But reliable messaging ensures that all messages sent  Reliable sessions can generate a significant amount of
from the source will arrive at the destination without additional network traffic, both in terms of the extra
duplication and messages are processed by the protocol messages and the increased size of each
destination in the order in which they were sent. message.
 Using reliable messaging, the WCF runtime will What is a nonce in WCF reliable
guarantee to deliver a message if it can, or it will alert
the sender if it cannot. messaging?
 When we enable replay detection, the WCF runtime
What is “keep alive” message from client generates a random, unique, signed, time-stamped
to the service in reliable messaging? identifier for each message. These identifiers are referred
 A WCF service can timeout if it doesn’t receive any to as nonces.
messages from a client within the period specified by its  Upon receiving a message, a service can use the
own InactivityTimeout property. signature to verify that the nonce has not been
 To prevent this from happening unnecessarily, the WCF corrupted and extract and examine the timestamp to
runtime on the client computer periodically sends a ascertain that the message was sent reasonably
“keep alive” message to the service if the client recently.
application has not sent any messages recently.
Chapter 11
What is a sequence number in messages
with WS-ReliableMessaging protocol?
Programmatically Controlling the
 The WS-ReliableMessaging protocol organizes messages Configuration and Communications
in a conversation between a client application and a
What is a CannenlListener object?
service by associating them with a unique identifier
 A ChannelListener object connects an endpoint to the
known as a sequence number.
transport channel for the channel stack
 All messages in the same reliable session must share the
 The WCF runtime creates a ChannelListener object for
same set of identifiers The body of this message contains
each URI on which the service can accept messages.
a unique identifier generated by the WCF runtime
What is the purpose an encoding channel?
 The purpose of an encoding channel is to parse the
incoming request message and convert it into a format
that the channels above it in the channel stack can
understand—usually SOAP.
What are Channel Dispatcher and  It provides a standardized, interoperable, and efficient
format for transmitting large blocks of binary data.
EndpointDispatcher?
 When an incoming request message reaches the top of
What is streaming data in WCF Service?
 Streaming allows the client application to start receiving
the channel stack, a Channel Dispatcher object takes
and processing bytes of data before the service has
the message, examines it, and passes it to an
transmitted the end of the message.
EndpointDispatcher object that invokes the appropriate
 If streaming enabled, the service and the client
method in the service, passing the data items in the
message as parameters to the method. application does not create large buffers for holding an
entire message.
What is service behavior scope?
 Behavior scope determines whether a service behavior is
Name the bindings that support streaming?
 basicHttpBinding
applicable to the entire service, contract, a specific
 netTcpBinding
operation or an endpoint.
 netNamedPipeBinding
Why do you use behavior element
extension class?
Chapter 14
 You can also define your own custom behaviors by Discovering Services and Routing
defining a corresponding behavior element extension
class. Messages
 A behavior extension element is a class that the WCF What is WCF discovery?
runtime uses to configure a behavior when it starts a  WCF Discovery enables a client application to locate a
service running and reads the configuration file service dynamically, based on criteria such as the
What is IDispatchMessageInspector contract that the service implements.

interface? What are the two modes supported by


 To create a message inspector, you create a class that WCF discovery API?
implements the IDispatchMessageInspector interface  WCF discovery API supports two modes of discovery:
and insert it into the configuration by defining a → Ad hoc discovery mode
behavior. → Managed discovery mode
Chapter 12 What is the difference between ad hoc
What is One-Way Operation? and managed modes of discovery?
 One-Way operation does not return back any data to  In Ad-Hoc mode, there is no centralized server. All
client. discovery messages such as service announcements
 When a client application invokes a one-way operation, and client requests are sent over the UDP protocol.
it can continue running without waiting for the service to  Clients have to actively listen for these announcements
complete the operation. and process them accordingly.
 In Managed mode there is a centralized server called a
What is Asynchronous Operation? discovery proxy that maintains information about
 The operation that is invoked by a client without process
available services.
blocking and client can continue execution further
 Clients use the discovery proxy to retrieve information
without operation return.
about available services.
 When a reply message arrives from the service, a
separate thread in the client application handles the What are Probe message and ProbeMatch
response. message in service discovery?
What are the effects  In WCF Discovery, when a client application wishes to
connect to a service, it broadcasts a Probe message
(restrictions/disadvantages) of one-way containing information about the service.
operation?  When the service receives a Probe request, it can
 It must be void examine its contents, and if the probe matches the
 It cannot take ref or out parameter contract implemented by the service, it can respond to
 Client does not know if operation call is successful or not the client with a ProbeMatch message.
Chapter 13  The ProbeMatch message contains the service
addressing information.
Implementing a WCF Service for What is udpDiscoveryEndpoint?
Good Performance  WCF provides a preconfigured discovery endpoint to
the service called udpDiscoveryEndpoint.
What is WCF Service Throttling?  The udpDiscoveryEndpoint endpoint has a fixed
 Service throttling is a feature to help control resource contract, a fixed HTTP binding, and a default address.
utilization.
 Using this feature we can ensure that a service does not
What is discovery announcement?
 The WCF discovery feature enables services to
exhaust the resources available on the host computer.
announce their availability.
Why is Load-balancing required in WCF  If configured to do so, a service broadcasts
service hosting environment? announcements when it starts and shuts down.
 Load balancing technique is used to distribute requests  Clients can listen for such announcement messages and
across multiple server. act on them.
 Load balancing is required if service hugely using What is a discovery proxy?
resources available on the host computer, causing the  A discovery proxy is a standalone service that contains a
system to slow down. repository of services.
What is MTOM?  Clients can query a discovery proxy to find discoverable
 MTOM is an optimization mechanism for sending and services that the proxy is aware of.
receiving SOAP messages that contain binary data.
What is a RoutingService? What is claim in authentication?
 A routing service is intermediary service between  A claim in the world of authentication and authorization
services and client. can be defined as a statement about an entity, typically
 A routing service routes messages based on message a user.
content, which allows a message to be forwarded to a What is claim-based security?
client endpoint based on a value within the message
 Claims-based identity is a common way for applications
itself, in either the header or the message body.
to acquire the identity information they need about
Chapter 15 users.

Discovering Services and Routing


Messages
What are two common architectures of
implementing Web Services?
 Simple Object Access Protocol (SOAP)
 Representational State Transfer (REST)
What is REST?
 REST stands for REpresentational State Transfer
 It is a simple stateless architecture that generally runs
over HTTP.
 The REST architectural style of developing Web services
as an alternative to other distributed-computing
specifications such as SOAP.
 The basic idea of REST is treating objects on the server-
side as resources than can be created or destroyed.
What is the difference between WebGet
and WebInvoke attributes?
 In a WCF REST Web service, you mark operations that
respond to HTTP GET requests with the WebGet attribute.
 To support HTTP POST, PUT, and DELETE requests, WCF
supplies the WebInvoke attribute
Chapter 16
Using a Callback Contract to Publish
and Subscribe to Events
What is difference between client/server
and peer-to-peer model of processing?
 In client/server model, a server provides a service that
waits passively for a request from a client application,
handles that request, and then optionally sends a
response back to the client application
 The client application is the active participant, making
requests and effectively determining when the service
should perform its work.
 In the peer-to-peer scenario, there are no passive
services. All applications are autonomous clients that
can communicate with each other.
What is client callback?
 A callback contract defines operations that a service
can invoke in a client application
What is callback contract?
 A callback contract is very similar to a service contract
in the respect that it is an interface or class that contains
operations marked with the OperationContract attribute
but you do not decorate it with the ServiceContract
attribute.
Chapter 17
Managing Identity with Windows
CardSpace
What is windows CardSpace?
 Windows CardSpace is an identity technology
incorporated into Windows Vista and Windows 7.
 CardSpace is used to create digital identities for users
that could be requested and accessed by websites or
other software applications.

Você também pode gostar