Upgrade to remove ads
WCF C Sharp 2010
Terms in this set (16)
What is Windows Communication Foundation and why did Microsoft create it?
WFC is a unified programming model for building service-oriented applications. The goal of Windows Foundation Communication is to be the one technology you can use to add inter-application communication to an application. Whether the application talks to a remote application over the Web or on the local network, you can use one programming model.
What is a service and what is a service-oriented application?
A service is a program that performs a task that you can interact with through well-defined messages. A service-oriented application consists of loosely coupled services that commuincate through messages and contract.
What is the role of messages and contracts in a service-oriented application?
To call a service, you pass it a message. The message includes a request for the service to take an action. If the service returns data to you, it will pass you a message. Contracts specify what requests you can make of a service and how it will respond.
What is the role of a WCF endpoint?
An endpoint specifies three things: the address of the service, the binding the service supports, and the contract that the service implements. The address specifies where the client should send messages. The binding specifies the mechanism that clents should use to send messages. The contract defines the types of messages that the service and client can send.
What is the role of a host application?
The role of a host application is to start and stop the service, listen for requests from clients, direct those requests to the service, and send responses back to the cleitns. The host provides the endpoints to clients, since the host is listening for and responding to client requests.
What are your options for hosting WCF services?
You can host a WCF service in any Windows process that supports managed code. This includes Internet Information Services (IIS), Windows Process Activation Service (WAS), and managed applications such as a console application, a Windows service, Windows Forms, of a Windows Presentation Foundation application (WPF).
What are the pros and cons of defining endpoints in code and configuration files?
Defining endpoints in code gives you complete control and enures that no one can change the endpoints once you deploy the application. However, to change the endpoints, you need to recompile the application. Defining endpoints in configuration files enables you to change them without rebuilding the application. This is more flexible, and it is typically the preferred approach, both on the servier and on the client.
What is the role of a channel and how do you create one?
Clients and service communicate by passing messages. The mechanism that they use to communicate is a channel, as in a communication channel. The ServiceHost object automatically creates the necessary channels for the service host. Each client must create channels, either in a proxy class or in code, to communicate with the service.
What channelscomprise the channel stack and which of them are required in a binding?
The Protocol channels include the Transaction Protocol channel, the Reliable Messaging Protocol channel, and the Security Protocols channel. These are optional in a binding. The transport channels include the Message Encoder channel and the Transport Protocol channel. These are required in a binding.
When and how wourld you create a custom binding?
You would create a custom binding when none of the standard bindings offers the features you want. To create a custom binding, you first create a collection of binding elements using the BindingElementCollection class. You then create an instance of the CustomBinding class and pass to the constructor of that class a collectioin fo binding elements.
WHat changes can you make in a service contract that won't immediately break client applications?
You can add a parameter to a method, remove a parameter from a method, or add a method.
What changes can you make in a data contract that wpm't immediately break client applications?
You can add or remove an optional member
What does a WCF service return to the client if the service throws an unhandled exception?
The WCF service cannot return a .NET exception to the client. Rather, the WCF runtime serializes the execpton into XML and returns it to the clent within a SOAP message.
What options do you have to handle exceptions in WCF services?
To customize the error message returned by a service, you can use the FaultException class. You can pass an instance of the FaultCode class to the FaultExecption constructor. You can then pass not only text to the clent, but also an error code. You can use the FaultReason class to provide a descroption of the fault. This class supports locale-based translations of messages. You can also throw a strongly typed SOAP fault.
What are two of the features WCF provides that you ca use to monitor and diagnose services?
You can add tracing and message logging to services. Tracing is the process of monitoring your application and recording what happens while it runs. Message loging records the contents of the messages that clients and service exchange.
What are the three primary message exchange patterns you can use in a WCF service?
In the request-reply pattern, the client sends a message to the service and then waits for the service to send a message back. In the one-way message exchange pattern, the client sends a message to the service and does not wait for a reply. In the duplex message exchange pattern, the clent can initiate the communication by sending a message to the service. In addition, the service can initiate the communication by sending a message to the client.
THIS SET IS OFTEN IN FOLDERS WITH...
DES - ASP .Net MVC 3
Programming Design Patterns (GoF+)
ASP.NET MVC 4 Controllers
YOU MIGHT ALSO LIKE...
Microsoft 2 Testbank 15
1.4.3 Service Account Facts
70-411 Server 2012 Quiz 15
General Micro/Web Services
OTHER SETS BY THIS CREATOR
SharePoint 70573 part 1
10175A Review Questions
SharePoint 2007 Questions