Professional Documents
Culture Documents
Description About WCF
Description About WCF
WCF (Window Communication Foundation) is a solution for developers to work in distributing environment. WCF
mainly for make communication between applications. Before WCF, the technologies to make communication
between applications were ASMX, .NET remoting, and COM+. WCF provides a common platform for all .NET
communication.
WCF is a framework for developing, configuring, exposing, and hosting services. All service providers were agree
on SOAP concept for making communication between application before WCF. The idea of WCF is a combination
of SOAP and web service.
With the help of XML-based config information we can configure an end point, programmatically using
methods/properties, or with both XML config files and some coding. WCF includes multiple usability avenues. For
example, we can use WCF out of the box with little or no coding or elect to build custom implementations for all
aspects of your service.
In making communication channels plays an important role, the WCF runtime detects the binding for creating the
channels. The main task of channel are receiving and transforming data. Data goes in one end of the channel, the
channel operates on the data, and new data is dumped out the other end of the channel.
Metadata describes the information how to communicate with the service.cleint can request metdata for learning
about the endpoint and message format.The service does not expose MEX enpoint, nobody can know the details of
service.For knowing address, binding and contract for the service, service should expose the mex endpoint. This can
be exposed in code or configuration
A- Address: this is the location or endpoint to which messages send by the clint
B- Binding: This defindes the channel to communicate with the address eg: basichttpbinding
C- Contact: It defines waht functionality or feature providd by this endpoint
what are the difference between webservice and WCF service
Web service can access only by the protocol http, but WCf can access any protocol and any transport type. WCF is
flexible. Same wcf services can access using differnt endpoints.
1) Authentication
2) Authorization
3) Integrity
4) Confidentiality
What is WAS?
It is a process activation mechanism implemented in Windows 2008. It can be used to host WCF servuces.
1. Windows Service
2. IIS Hosting
It's an Interface, it paves a way on how the client should communicate with the service.
It has three points, they are;
1) Address - defines where the service resides
2) Binding - defines how to communicate
3) Contract - defines what the service does
There are three ways available through which we can host the WCF Service, They are;
2) Self hosting
WcfTestClient.exe
It resides in the folder
drive:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
eventvwr.exe
Every service must have Address that defines where the service resides, Contract that defines what the service does
and a Binding that defines how to communicate with the service. In WCF the relationship between Address,
Contract and Binding is called Endpoint.
Transport reliability (such as the one offered by TCP) offers point-to-point guaranteed delivery at the network
packet level, as well as guarantees the order of the packets. Transport reliability is not resilient to dropping network
connections and a variety of other communication problems.
Message reliability deals with reliability at the message level independent of how many packets are required to
deliver the message. Message reliability provides for end-to-end guaranteed delivery and order of messages,
regardless of how many intermediaries are involved, and how many network hops are required to deliver the
message from the client to the service.
Transactions in WCF allow several components to concurrently participate in an operation. Transactions are a group
of operations that are atomic, consistent, isolated and durable. WCF has features that allow distributed transactions.
Application config file can be used for setting transaction timeouts.
Advantages:-
------------
1. WCF is interoperable with other services when compared to .Net Remoting,where the client and service have to
be .Net.
2. WCF services provide better reliability and security in compared to ASMX web services.
3. In WCF, there is no need to make much change in code for implementing the security model and changing the
binding. Small changes in the configuration will make your requirements.
4. WCF has integrated logging mechanism, changing the configuration file settings will provide this functionality. In
other technology developer has to write the code.
No
Which contract is used to documented the view for error occurred in the service to client in wcf?
Fault Contract is used to documented the view for error occurred in the service to client in wcf
System.ServiceModel
What is UDDI?
It is a platform independent XML based registry that made the process of finding web services easier.
SOA is Service Oriented Architecture. SOA service is the encapsulation of a high level business concept. A SOA
service is composed of three parts.
1. A service class implementing the service to be provided.
2. An environment to host the service.
3. One or more endpoints to which clients will connect.
System.ServiceModel
Which format is used When sending and retrieving a DataSet from an XML Web service?
DiffGram format
Can you give an example of when it would be appropriate to use a web service as opposed to a non-
serviced .NET component?
Services:
o Communicating through a Firewall When building a distributed application with 100s/1000s of users spread over
multiple locations, there is always the problem of communicating between client and server because of firewalls and
proxy servers. Exposing your middle tier components as Web Services and invoking the directly from a Windows
UI is a very valid option.
o Application Integration When integrating applications written in various languages and running on disparate
systems. Or even applications running on the same platform that have been written by separate vendors.
o Business-to-Business Integration This is an enabler for B2B intergtation which allows one to expose vital business
processes to authorized supplier and customers. An example would be exposing electronic ordering and invoicing,
allowing customers to send you purchase orders and suppliers to send you invoices electronically.
o Software Reuse This takes place at multiple levels. Code Reuse at the Source code level or binary componet-based
resuse. The limiting factor here is that you can reuse the code but not the data behind it. Webservice overcome this
limitation. A scenario could be when you are building an app that aggregates the functionality of serveral other
Applicatons. Each of these functions could be performed by individual apps, but there is value in perhaps combining
the the multiple apps to present a unifiend view in a Portal or Intranet.
o When not to use Web Services: Single machine Applicatons When the apps are running on the same machine and
need to communicate with each other use a native API. You also have the options of using component technologies
such as COM or .NET Componets as there is very little overhead.
o Homogeneous Applications on a LAN If you have Win32 or Winforms apps that want to communicate to their
server counterpart. It is much more efficient to use DCOM in the case of Win32 apps and .NET Remoting in the
case of .NET Apps.
What are the important principles of SOA (Service oriented Architecture)?
Explain how Ends, Contract, Address, and Bindings are done in WCF?
What are the advantages of hosting WCF Services in IIS as compared to self-hosting?
What are the major differences between services and Web services?