Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

DOTNETSPARK

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.

There are two categories of classes in WCF.


. Service model classes handle configuration and validation.
. Channel layer classes handle things such as communication and data transformation.
WCF services expose functionality through one or more endpoints. Clients communicate with the service's
endpoint. In configuring an end points there are three components require.
. Address
. Binding
. Contract
These three components are interrelated.

An address mean an URL.

Binding tells the WCF runtime how your endpoint communicates.

Contracts mean it gives the information of working endpoints.

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.

What is Metadata Exchange(MEX) endpoint

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

What is ABCs in WCF

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.

What are the 4 security features of WCF?

1) Authentication
2) Authorization
3) Integrity
4) Confidentiality

What is WAS?

WAS is Windows Process Activation Service.

It is a process activation mechanism implemented in Windows 2008. It can be used to host WCF servuces.

What are the 3 ways to host WCF services?

1. Windows Service

2. IIS Hosting

3. Windows Activation Services (WAS)

What is DataContract and ServiceContract?Explain

Data represented by creating DataContract which expose the


data which will be transefered /consumend from the serive
to its clients.

**Operations which is the functions provided by this


service.

To write an operation on WCF,you have to write it as an


interface,This interface contains the "Signature" of the
methods tagged by ServiceContract attribute,and all methods
signature will be impelemtned on this interface tagged with
OperationContract attribute.

and to implement these serivce contract you have to create


a class which implement the interface and the actual
implementation will be on that class.

Code Below show How to create a Service Contract:


[ServiceContract]
Public Interface IEmpOperations
{
[OperationContract]
Decimal Get EmpSal(int EmpId);

Class MyEmp: IEmpOperations


{
Decimal Get EmpSal()
{
// Implementation of this method.
}
}

Hope now you can differentiate between Data


Contract,Service Contract and OperationContract.

What is meant by EndPoint in WCF?

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

What are the various ways of hosting a WCF Service?

There are three ways available through which we can host the WCF Service, They are;

1) Using Internet Information Server(IIS)

2) Self hosting

3) Windows Activation Service (WAS)

what are the advantages of WCF service over Web Service?

1) WCF service supports both the HTTP and TCP Protocol


2) The reliability is more
3) It has a greater flexibility.

What is the utility name to test WCF services?

WcfTestClient.exe
It resides in the folder
drive:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

What is the application utility name to view logs in WCF?

eventvwr.exe

What is service and client in perspective of data communication?

A service is a unit of functionality exposed to the world.

The client of a service is merely the party consuming the service.

What is endpoint in WCF?

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.

The Endpoint is the fusion of Address, Contract and Binding.

What is Transport and Message Reliability?

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.

Explain transactions in WCF?

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.

What are the Advantage of WCF?

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.

Whether webservices support data reader?

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

Which namespace is used to access WCF service?

System.ServiceModel

What is UDDI?

UDDI stands for Universal Description, Discovery and Integration.

It is a platform independent XML based registry that made the process of finding web services easier.

What is a SOA Service?

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.

Which namespace is used to access WCF?

System.ServiceModel

Which format is used When sending and retrieving a DataSet from an XML Web service?

DiffGram format

What is a Messaging Protocol in webservice?


The format of messages exchanged between Web Services clients and Web Services should be vendor neutral and
should not carry details about the technology used to implement the service. Also, the message format should allow
for extensions and different bindings to specific transport protocols. SOAP and ebXML Transport are specifications
which fulfill these requirements. We expect that the W3C XML Protocol Working Group defines a successor
standard

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)?

What are ends, contract, address, and bindings?

Which specifications does WCF follow?

What are the main components of WCF?

Explain how Ends, Contract, Address, and Bindings are done in WCF?

What is a service class?

What is a service contract, operation contract and Data Contract?

What are the various ways of hosting a WCF service?

How do we host a WCF service in IIS?

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?

What is the difference WCF and Web services?

What are different bindings supported by WCF?

Which are the various programming approaches for WCF?

What is one-way operation?

Can you explain duplex contracts in WCF?

How can we host a service on two different protocols on a single server?

How can we use MSMQ bindings in WCF?

Can you explain transactions in WCF?

What different transaction isolation levels provided in WCF?

Can we do transactions using MSMQ?


Can we have two-way communications in MSMQ?

What are Volatile queues?

What are Dead letter queues?

What is a poison message?

You might also like