<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Prepare 4 interview - Recent questions and answers in .NET Interview Questions and Answers</title>
<link>http://prepare4interview.com/qa/net-interview-questions-and-answers</link>
<description>Powered by Question2Answer</description>
<item>
<title>Answered: What is the latest version of .NET</title>
<link>http://prepare4interview.com/1783/what-is-the-latest-version-of-net#a1801</link>
<description>frameowrk 4.5</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1783/what-is-the-latest-version-of-net#a1801</guid>
<pubDate>Sun, 25 Mar 2012 08:40:36 +0000</pubDate>
</item>
<item>
<title>Answered: Which namespace is used to access WCF service?</title>
<link>http://prepare4interview.com/985/which-namespace-is-used-to-access-wcf-service#a1782</link>
<description>System.ServiceModel</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/985/which-namespace-is-used-to-access-wcf-service#a1782</guid>
<pubDate>Wed, 05 Oct 2011 16:10:33 +0000</pubDate>
</item>
<item>
<title>Answered: what are design patterns?</title>
<link>http://prepare4interview.com/547/what-are-design-patterns#a1781</link>
<description>Design patterns are recurring solutions to software design problems you find again and again in real-world application development. Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges. &lt;br /&gt;
&lt;br /&gt;
The Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral. Here you will find information on these important patterns. &lt;br /&gt;
&lt;br /&gt;
To give you a head start, the C# source code is provided in 2 forms: 'structural' and 'real-world'. Structural code uses type names as defined in the pattern definition and UML diagrams. Real-world code provides real-world programming situations where you may use these patterns. &lt;br /&gt;
&lt;br /&gt;
A third form, '.NET optimized' demonstrates design patterns that exploit built-in .NET 4.0 features, such as, generics, attributes, delegates, object and collection initializers, automatic properties, and reflection</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/547/what-are-design-patterns#a1781</guid>
<pubDate>Wed, 05 Oct 2011 16:02:14 +0000</pubDate>
</item>
<item>
<title>Answered: What are the major differences between services and Web services? What is the difference WCF and Web services?</title>
<link>http://prepare4interview.com/1735/differences-between-services-services-difference-services#a1739</link>
<description>The Windows Communication Foundation (or WCF) is an application programming interface (API) in the .NET Framework for building connected, service-oriented applications.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1735/differences-between-services-services-difference-services#a1739</guid>
<pubDate>Wed, 10 Nov 2010 11:30:10 +0000</pubDate>
</item>
<item>
<title>Answered: What are different bindings supported by WCF?</title>
<link>http://prepare4interview.com/1737/what-are-different-bindings-supported-by-wcf#a1738</link>
<description>WCF includes predefined bindings. They cover most of bindings widely needed in day-to-day application. However, just incase you find that you need to define something custom WCF does not stop you. So let us try to understand what each binding provides.&lt;br /&gt;
&lt;br /&gt;
BasicHttpBinding:&lt;br /&gt;
-----------------&lt;br /&gt;
This binding is used when we need to use SOAP over HTTP. This binding can also be configured to be used as HTTPS. It can be also configured to send data in plain text or in optimized form like MTOM.&lt;br /&gt;
&lt;br /&gt;
WsHttpBinding:&lt;br /&gt;
-----------------&lt;br /&gt;
It is same like BasicHttpBinding. In short, it uses SOAP over HTTP. But with it also supports reliable message transfer, security and transaction. WS-Reliable Messaging, security with WS-Security, and transactions with WS-Atomic Transaction supports reliable message.&lt;br /&gt;
&lt;br /&gt;
NetTcpBinding:&lt;br /&gt;
-----------------&lt;br /&gt;
This binding sends binary-encoded SOAP, including support for reliable message transfer, security, and transactions, directly over TCP. The biggest disadvantage of NetTcpBinding is that both server and client should be also made in .NET language.&lt;br /&gt;
&lt;br /&gt;
NetNamedPipesBinding:&lt;br /&gt;
-----------------&lt;br /&gt;
This binding Sends binary-encoded SOAP over named pipes. This binding is only usable for WCF-to-WCF communication between processes on the same Windows-based machine.&lt;br /&gt;
&lt;br /&gt;
NetMsmqBinding:&lt;br /&gt;
-----------------&lt;br /&gt;
This binding sends binary-encoded SOAP over MSMQ. This binding can only be used for WCF-to-WCF communication.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1737/what-are-different-bindings-supported-by-wcf#a1738</guid>
<pubDate>Sun, 31 Oct 2010 18:53:26 +0000</pubDate>
</item>
<item>
<title>What are the advantages of hosting WCF Services in IIS as compared to self-hosting?</title>
<link>http://prepare4interview.com/1733/what-advantages-hosting-services-iis-compared-self-hosting</link>
<description></description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1733/what-advantages-hosting-services-iis-compared-self-hosting</guid>
<pubDate>Sun, 31 Oct 2010 18:50:21 +0000</pubDate>
</item>
<item>
<title>Answered: How do we host a WCF service in IIS?</title>
<link>http://prepare4interview.com/1731/how-do-we-host-a-wcf-service-in-iis#a1732</link>
<description>First thing you will need is to create the SVC file, which exposes the service class. SVC file contains the pointer to the class. You can see from the figure below the class attribute points to the class whose interface is exposed by the service.svc.cs file. Also, note the actual interface is in service.svc.cs file. Below figure, have both the files service.svc, which has the class attribute which points to the service class, and the interface, which resides in service.svc.cs file.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1731/how-do-we-host-a-wcf-service-in-iis#a1732</guid>
<pubDate>Sun, 31 Oct 2010 18:46:29 +0000</pubDate>
</item>
<item>
<title>Answered: what are the various ways of hosting a WCF service?</title>
<link>http://prepare4interview.com/1729/what-are-the-various-ways-of-hosting-a-wcf-service#a1730</link>
<description>There are three major ways to host a WCF service:-&lt;br /&gt;
* Self-hosting the service in his own application domain. This we have already covered in the first section. The service comes in to existence when you create the object of Service Host class and the service closes when you call the Close of the Service Host class.&lt;br /&gt;
* Host in application domain or process provided by IIS Server.&lt;br /&gt;
* Host in Application domain and process provided by WAS (Windows Activation Service) Server.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1729/what-are-the-various-ways-of-hosting-a-wcf-service#a1730</guid>
<pubDate>Sun, 31 Oct 2010 18:45:36 +0000</pubDate>
</item>
<item>
<title>What are the main components of WCF?</title>
<link>http://prepare4interview.com/1727/what-are-the-main-components-of-wcf</link>
<description></description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1727/what-are-the-main-components-of-wcf</guid>
<pubDate>Sun, 31 Oct 2010 18:44:10 +0000</pubDate>
</item>
<item>
<title>Which specifications does WCF follow?</title>
<link>http://prepare4interview.com/1725/which-specifications-does-wcf-follow</link>
<description></description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1725/which-specifications-does-wcf-follow</guid>
<pubDate>Sun, 31 Oct 2010 18:42:40 +0000</pubDate>
</item>
<item>
<title>Answered: What are ends, contract, address, and bindings?</title>
<link>http://prepare4interview.com/1723/what-are-ends-contract-address-and-bindings#a1724</link>
<description>The above terminologies are the core on which SOA stands. Every service must expose one or more ends by which the service can be available to the client. End consists of three important things where, what and how:-&lt;br /&gt;
• Contract (What)&lt;br /&gt;
Contract is an agreement between two or more parties. It defines the protocol how client should communicate with your service. Technically, it describes parameters and return values for a method.&lt;br /&gt;
• Address (Where)&lt;br /&gt;
An Address indicates where we can find this service. Address is a URL, which points to the location of the service.&lt;br /&gt;
• Binding (How)&lt;br /&gt;
Bindings determine how this end can be accessed. It determines how communications is done. For instance, you expose your service, which can be accessed using SOAP over HTTP or BINARY over TCP. So for each of these communications medium two bindings will be created.&lt;br /&gt;
Below figure, show the three main components of end. You can see the stock ticker is the service class, which has an end hosted on www.soa.com with HTTP and TCP binding support and using Stock Ticker interface type.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1723/what-are-ends-contract-address-and-bindings#a1724</guid>
<pubDate>Sun, 31 Oct 2010 18:34:59 +0000</pubDate>
</item>
<item>
<title>Answered: What are the important principles of SOA (Service oriented Architecture)?</title>
<link>http://prepare4interview.com/1721/what-important-principles-service-oriented-architecture#a1722</link>
<description>WCF is based on SOA. All big companies are playing big bets on SOA. So how can Microsoft remain behind? So in order to implement SOA architecture easily you need to use WCF.&lt;br /&gt;
SOA is based on four important concepts:-&lt;br /&gt;
• Boundaries are well defined&lt;br /&gt;
In SOA, everything is formalized. The client who is consuming the service does not need to know how the implementation of the service is done. If you look at some old methodologies of communication like DCOM. Any changes at server level the client also has to change. Therefore, the server and client implementation was so much bound that changes need to be done at all places. In SOA, the rule is if you do enhancement you do not need to change anything at the client. SOA based application only understands that there is an end point, contract, and bindings.&lt;br /&gt;
• Services evolve&lt;br /&gt;
Change is the law of nature and services will evolve. In SOA, services can be versioned and you can host those services in new ends. For instance, you have a service called as “Search Tickets (Ticket Number) “which gives details based on Ticket Number and its exposed on end point “ep1”. Tomorrow you want make your Search Tickets service more useful by also providing an extra option of allowing him to search by passenger name. Therefore, you just declare a new end “ep2” with service “Search Tickets (Ticket Number, Passenger Name)”. So the client who is consuming the service at end ep1 continues and at the other end, we have evolved our service by adding new ends ep2.&lt;br /&gt;
• Services share only schemas and contracts&lt;br /&gt;
Services use Schemas to represent data and contracts to understand behavior. They do not use language dependent types or classes in order to understand data and behavior. XML is used to define schemas and contracts. Due to this, there is not heavy coupling between environments.&lt;br /&gt;
&amp;nbsp;• Service compatibility is policy based&lt;br /&gt;
Policy describes the capabilities of the system. Depending on policies, the service can degrade to match the service for the client. For instance your service needs to be hosted for two types of client one which uses Remoting as the communication methodology while other client uses DCOM. An ideal SOA service can cater to both of them according to there communication policies.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1721/what-important-principles-service-oriented-architecture#a1722</guid>
<pubDate>Sun, 31 Oct 2010 18:29:46 +0000</pubDate>
</item>
<item>
<title>Answered: What is WCF?</title>
<link>http://prepare4interview.com/1719/what-is-wcf#a1720</link>
<description>First let us give a short answer to this: - \&amp;quot;WCF (Indigo was the code name for WCF) is a unification of .NET framework communication technologies\&amp;quot;. WCF is a unification technology, which unites the following technologies:-&lt;br /&gt;
</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1719/what-is-wcf#a1720</guid>
<pubDate>Sun, 31 Oct 2010 18:28:22 +0000</pubDate>
</item>
<item>
<title>Answered: What is Windows Card Space?</title>
<link>http://prepare4interview.com/1717/what-is-windows-card-space#a1718</link>
<description>It was previously known by its codename Info Card. It is a framework by Microsoft, which securely stores digital identities of a user and provides a unified interface to choose the identity for a particular transaction, such as logging in to a website. Windows Card Space is a central part of Microsoft</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1717/what-is-windows-card-space#a1718</guid>
<pubDate>Sun, 31 Oct 2010 18:27:12 +0000</pubDate>
</item>
<item>
<title>What is .NET 3.0?</title>
<link>http://prepare4interview.com/1715/what-is-net-3-0</link>
<description></description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1715/what-is-net-3-0</guid>
<pubDate>Sun, 31 Oct 2010 18:24:07 +0000</pubDate>
</item>
<item>
<title>Answered: Can you explain the concept of trace listener?</title>
<link>http://prepare4interview.com/1076/can-you-explain-the-concept-of-trace-listener#a1077</link>
<description>‘Tracelistener’ are objects that get tracing information from the trace class and they output the data to some medium. For instance you can see from the figure ‘TraceListener’ how it listens to the trace object and outputs the same to UI, File or a windows event log. There are three different types of ‘tracelistener’ first is the ‘defaulttracelistener’ (this outputs the data to UI), second is ‘textwritertracelistener’ (this outputs to a file) and the final one is ‘Eventlogtracelistener’ which outputs the same to a windows event log.&lt;br /&gt;
&lt;br /&gt;
Below is a code snippet for ‘textwritertracelistener’ and ‘eventlogtracelistener’. Using ‘textwritertracelistener’ we have forwarded the trace’s to ‘ErrorLog.txt’ file and in the second snippet we have used the ‘Eventlogtracelistener’ to forward the trace’s to windows event log.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1076/can-you-explain-the-concept-of-trace-listener#a1077</guid>
<pubDate>Thu, 29 Jul 2010 14:19:58 +0000</pubDate>
</item>
<item>
<title>Answered: How can we enable tracing on the readymade tracing WCF objects?</title>
<link>http://prepare4interview.com/1074/how-can-enable-tracing-on-the-readymade-tracing-wcf-objects#a1075</link>
<description>We will enable tracing on ‘System.ServiceModel’ tracing object. To enable tracing we need to enable the ‘system.diagnostics’ XML node in the ‘web.config’ file of the WCF service. We need to also define the type of listeners for the ‘System.ServiceModel’ listener object. So we add the ‘listeners’ tag with the type as ‘System.Diagnostics.XmlWriterTraceListener’. We need to also define the file and path where the file is created. For the current scenario we have defined the file as ‘Traces.svclog’ and the folder as ‘c:\’ drive.&lt;br /&gt;
&amp;lt;system.diagnostics&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sources&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source name=&amp;quot;System.ServiceModel&amp;quot;&lt;br /&gt;
&lt;br /&gt;
switchValue=&amp;quot;Information, ActivityTracing&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;listeners&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;add name=&amp;quot;log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type=&amp;quot;System.Diagnostics.XmlWriterTraceListener&amp;quot;&lt;br /&gt;
&lt;br /&gt;
initializeData=&amp;quot;c:\Traces.svclog&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/listeners&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/sources&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system.diagnostics&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now if you run the WCF service you can see a XML file created as shown below.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;E2ETraceEvent xmlns=&amp;quot;http://schemas.microsoft.com/2004/06/E2ETraceEvent&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;System xmlns=&amp;quot;http://schemas.microsoft.com/2004/06/windows/eventlog/system&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;EventID&amp;gt;0&amp;lt;/EventID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Type&amp;gt;3&amp;lt;/Type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;SubType Name=&amp;quot;Transfer&amp;quot;&amp;gt;0&amp;lt;/SubType&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Level&amp;gt;255&amp;lt;/Level&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;TimeCreated SystemTime=&amp;quot;2009-04-30T03:21:09.5625000Z&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Source Name=&amp;quot;System.ServiceModel&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Correlation ActivityID=&amp;quot;{00000000-0000-0000-0000-000000000000}&amp;quot; RelatedActivityID=&amp;quot;{d11829b7-d2db-46d5-a4ac-49a37a56376e}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Execution ProcessName=&amp;quot;WebDev.WebServer&amp;quot; ProcessID=&amp;quot;2660&amp;quot; ThreadID=&amp;quot;8&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Channel/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Computer&amp;gt;COMPAQ-JZP37MD0&amp;lt;/Computer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/System&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ApplicationData&amp;gt;&amp;lt;/ApplicationData&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/E2ETraceEvent&amp;gt;</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1074/how-can-enable-tracing-on-the-readymade-tracing-wcf-objects#a1075</guid>
<pubDate>Thu, 29 Jul 2010 14:18:32 +0000</pubDate>
</item>
<item>
<title>Answered: For which bindings are transport, message and mixed mode supported?</title>
<link>http://prepare4interview.com/1072/which-bindings-transport-message-and-mixed-mode-supported#a1073</link>
<description>Note :- The below table is taken from book Pro WCF: Practical Microsoft SOA Implementation -- Chris peiris and Denis mulder – Apress 2007&lt;br /&gt;
&lt;br /&gt;
Below is a table which shows for which binding which mode is supported. We did not discuss the mixed mode. It’s nothing but combination of transport and mixed mode. For instance data encrypted and passed over WsHttp using HTTPS is a mixed mode of security. Encryption is nothing but message security and HTTPS is a transport mode. In a combination they form mixed mode. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Binding&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Transport Mode?&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Message Mode?&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Mixed Mode?&lt;br /&gt;
&lt;br /&gt;
BasicHttpBinding&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&lt;br /&gt;
&lt;br /&gt;
WsHttpBinding&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&lt;br /&gt;
&lt;br /&gt;
WsDualHttpBinding&amp;nbsp; &amp;nbsp; &lt;br /&gt;
No&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
No&lt;br /&gt;
&lt;br /&gt;
NetTcpBinding&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&lt;br /&gt;
&lt;br /&gt;
NetNamedPipeBinding&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
No&amp;nbsp; &amp;nbsp; &lt;br /&gt;
No&lt;br /&gt;
&lt;br /&gt;
NetMsmqBinding&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
No&lt;br /&gt;
&lt;br /&gt;
MsmqIntegrationBinding&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Yes&amp;nbsp; &amp;nbsp; &lt;br /&gt;
No&amp;nbsp; &amp;nbsp; &lt;br /&gt;
No</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1072/which-bindings-transport-message-and-mixed-mode-supported#a1073</guid>
<pubDate>Thu, 29 Jul 2010 14:17:45 +0000</pubDate>
</item>
<item>
<title>Answered: What is service and client in perspective of data communication?</title>
<link>http://prepare4interview.com/1070/what-is-service-and-client-perspective-data-communication#a1071</link>
<description>A service is a unit of functionality exposed to the world. &lt;br /&gt;
&lt;br /&gt;
The client of a service is merely the party consuming the service.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1070/what-is-service-and-client-perspective-data-communication#a1071</guid>
<pubDate>Thu, 29 Jul 2010 14:16:21 +0000</pubDate>
</item>
<item>
<title>Answered: What is address in WCF and how many types of transport schemas are there in WCF?</title>
<link>http://prepare4interview.com/1068/what-address-wcf-how-many-types-transport-schemas-are-there#a1069</link>
<description>Address is a way of letting client know that where a service is located. In WCF, every service is associated with a unique address. This contains the location of the service and transport schemas. &lt;br /&gt;
&lt;br /&gt;
WCF supports following transport schemas &lt;br /&gt;
&lt;br /&gt;
HTTP &lt;br /&gt;
TCP &lt;br /&gt;
Peer network &lt;br /&gt;
IPC (Inter-Process Communication over named pipes) &lt;br /&gt;
MSMQ &lt;br /&gt;
&lt;br /&gt;
The sample address for above transport schema may look like &lt;br /&gt;
&lt;br /&gt;
http://localhost:81 &lt;br /&gt;
http://localhost:81/MyService &lt;br /&gt;
net.tcp://localhost:82/MyService &lt;br /&gt;
net.pipe://localhost/MyPipeService &lt;br /&gt;
net.msmq://localhost/private/MyMsMqService &lt;br /&gt;
net.msmq://localhost/MyMsMqService</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1068/what-address-wcf-how-many-types-transport-schemas-are-there#a1069</guid>
<pubDate>Thu, 29 Jul 2010 14:15:41 +0000</pubDate>
</item>
<item>
<title>Answered: Where we can host WCF services?</title>
<link>http://prepare4interview.com/1066/where-we-can-host-wcf-services#a1067</link>
<description>Every WCF services must be hosted somewhere. There are three ways of hosting WCF services. &lt;br /&gt;
&lt;br /&gt;
They are &lt;br /&gt;
&lt;br /&gt;
1. IIS &lt;br /&gt;
2. Self Hosting &lt;br /&gt;
3. WAS (Windows Activation Service) &lt;br /&gt;
&lt;br /&gt;
For more details see http://msdn.microsoft.com/en-us/library/bb332338.aspx</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1066/where-we-can-host-wcf-services#a1067</guid>
<pubDate>Thu, 29 Jul 2010 14:14:39 +0000</pubDate>
</item>
<item>
<title>Answered: What is binding and how many types of bindings are there in WCF?</title>
<link>http://prepare4interview.com/1063/what-is-binding-and-how-many-types-of-bindings-are-there-in-wcf#a1064</link>
<description>A binding defines how an endpoint communicates to the world. A binding defines the transport (such as HTTP or TCP) and the encoding being used (such as text or binary). A binding can contain binding elements that specify details like the security mechanisms used to secure messages, or the message pattern used by an endpoint. &lt;br /&gt;
&lt;br /&gt;
WCF supports nine types of bindings. &lt;br /&gt;
&lt;br /&gt;
Basic binding &lt;br /&gt;
&lt;br /&gt;
Offered by the BasicHttpBinding class, this is designed to expose a WCF service as a legacy ASMX web service, so that old clients can work with new services. When used by the client, this binding enables new WCF clients to work with old ASMX services. &lt;br /&gt;
&lt;br /&gt;
TCP binding &lt;br /&gt;
&lt;br /&gt;
Offered by the NetTcpBinding class, this uses TCP for cross-machine communication on the intranet. It supports a variety of features, including reliability, transactions, and security, and is optimized for WCF-to-WCF communication. As a result, it requires both the client and the service to use WCF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Peer network binding &lt;br /&gt;
&lt;br /&gt;
Offered by the NetPeerTcpBinding class, this uses peer networking as a transport. The peer network-enabled client and services all subscribe to the same grid and broadcast messages to it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IPC binding &lt;br /&gt;
&lt;br /&gt;
Offered by the NetNamedPipeBinding class, this uses named pipes as a transport for same-machine communication. It is the most secure binding since it cannot accept calls from outside the machine and it supports a variety of features similar to the TCP binding. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web Service (WS) binding &lt;br /&gt;
&lt;br /&gt;
Offered by the WSHttpBinding class, this uses HTTP or HTTPS for transport, and is designed to offer a variety of features such as reliability, transactions, and security over the Internet. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Federated WS binding &lt;br /&gt;
&lt;br /&gt;
Offered by the WSFederationHttpBinding class, this is a specialization of the WS binding, offering support for federated security. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Duplex WS binding &lt;br /&gt;
&lt;br /&gt;
Offered by the WSDualHttpBinding class, this is similar to the WS binding except it also supports bidirectional communication from the service to the client. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MSMQ binding &lt;br /&gt;
&lt;br /&gt;
Offered by the NetMsmqBinding class, this uses MSMQ for transport and is designed to offer support for disconnected queued calls. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MSMQ integration binding &lt;br /&gt;
&lt;br /&gt;
Offered by the MsmqIntegrationBinding class, this converts WCF messages to and from MSMQ messages, and is designed to interoperate with legacy MSMQ clients. &lt;br /&gt;
&lt;br /&gt;
For WCF binding comparison, see http://www.pluralsight.com/community/blogs/aaron/archive/2007/03/22/46560.aspx</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1063/what-is-binding-and-how-many-types-of-bindings-are-there-in-wcf#a1064</guid>
<pubDate>Thu, 29 Jul 2010 14:14:03 +0000</pubDate>
</item>
<item>
<title>Answered: What is endpoint in WCF?</title>
<link>http://prepare4interview.com/1061/what-is-endpoint-in-wcf#a1062</link>
<description>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. &lt;br /&gt;
&lt;br /&gt;
The Endpoint is the fusion of Address, Contract and Binding.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1061/what-is-endpoint-in-wcf#a1062</guid>
<pubDate>Thu, 29 Jul 2010 14:12:43 +0000</pubDate>
</item>
<item>
<title>Answered: How to define a service as REST based service in WCF?</title>
<link>http://prepare4interview.com/1059/how-to-define-a-service-as-rest-based-service-in-wcf#a1060</link>
<description>WCF 3.5 provides explicit support for RESTful communication using a new binding named WebHttpBinding. &lt;br /&gt;
The below code shows how to expose a RESTful service &lt;br /&gt;
&lt;br /&gt;
[ServiceContract]&lt;br /&gt;
&lt;br /&gt;
interface IStock&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
[OperationContract]&lt;br /&gt;
&lt;br /&gt;
[WebGet]&lt;br /&gt;
&lt;br /&gt;
int GetStock(string StockId);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By adding the WebGetAttribute, we can define a service as REST based service that can be accessible using HTTP GET operation.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1059/how-to-define-a-service-as-rest-based-service-in-wcf#a1060</guid>
<pubDate>Thu, 29 Jul 2010 14:12:07 +0000</pubDate>
</item>
<item>
<title>Answered: What is the address formats of the WCF transport schemas?</title>
<link>http://prepare4interview.com/1056/what-is-the-address-formats-of-the-wcf-transport-schemas#a1058</link>
<description>Address format of WCF transport schema always follow &lt;br /&gt;
&lt;br /&gt;
[transport]://[machine or domain][:optional port] format. &lt;br /&gt;
&lt;br /&gt;
for example: &lt;br /&gt;
&lt;br /&gt;
HTTP Address Format &lt;br /&gt;
&lt;br /&gt;
http://localhost:8888 &lt;br /&gt;
the way to read the above url is &lt;br /&gt;
&lt;br /&gt;
&amp;quot;Using HTTP, go to the machine called localhost, where on port 8888 someone is waiting&amp;quot; &lt;br /&gt;
When the port number is not specified, the default port is 80. &lt;br /&gt;
&lt;br /&gt;
TCP Address Format &lt;br /&gt;
&lt;br /&gt;
net.tcp://localhost:8888/MyService &lt;br /&gt;
&lt;br /&gt;
When a port number is not specified, the default port is 808: &lt;br /&gt;
&lt;br /&gt;
net.tcp://localhost/MyService &lt;br /&gt;
&lt;br /&gt;
NOTE: Two HTTP and TCP addresses from the same host can share a port, even on the same machine. &lt;br /&gt;
&lt;br /&gt;
IPC Address Format &lt;br /&gt;
net.pipe://localhost/MyPipe &lt;br /&gt;
&lt;br /&gt;
We can only open a named pipe once per machine, and therefore it is not possible for two named pipe addresses to share a pipe name on the same machine. &lt;br /&gt;
&lt;br /&gt;
MSMQ Address Format &lt;br /&gt;
net.msmq://localhost/private/MyService &lt;br /&gt;
net.msmq://localhost/MyService</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1056/what-is-the-address-formats-of-the-wcf-transport-schemas#a1058</guid>
<pubDate>Thu, 29 Jul 2010 14:11:32 +0000</pubDate>
</item>
<item>
<title>Answered: What are contracts in WCF?</title>
<link>http://prepare4interview.com/1054/what-are-contracts-in-wcf#a1055</link>
<description>In WCF, all services expose contracts. The contract is a platform-neutral and standard way of describing what the service does. &lt;br /&gt;
&lt;br /&gt;
WCF defines four types of contracts. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Service contracts &lt;br /&gt;
&lt;br /&gt;
Describe which operations the client can perform on the service. &lt;br /&gt;
There are two types of Service Contracts. &lt;br /&gt;
ServiceContract - This attribute is used to define the Interface. &lt;br /&gt;
OperationContract - This attribute is used to define the method inside Interface. &lt;br /&gt;
&lt;br /&gt;
[ServiceContract]&lt;br /&gt;
&lt;br /&gt;
interface IMyContract&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[OperationContract]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;string MyMethod( );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class MyService : IMyContract&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public string MyMethod( )&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Data contracts &lt;br /&gt;
&lt;br /&gt;
Define which data types are passed to and from the service. WCF defines implicit contracts for built-in types such as int and string, but we can easily define explicit opt-in data contracts for custom types. &lt;br /&gt;
&lt;br /&gt;
There are two types of Data Contracts. &lt;br /&gt;
DataContract - attribute used to define the class &lt;br /&gt;
DataMember - attribute used to define the properties. &lt;br /&gt;
&lt;br /&gt;
[DataContract]&lt;br /&gt;
&lt;br /&gt;
class Contact&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[DataMember]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public string FirstName;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[DataMember]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;public string LastName;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If DataMember attributes are not specified for a properties in the class, that property can't be passed to-from web service. &lt;br /&gt;
&lt;br /&gt;
Fault contracts &lt;br /&gt;
&lt;br /&gt;
Define which errors are raised by the service, and how the service handles and propagates errors to its clients. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Message contracts &lt;br /&gt;
&lt;br /&gt;
Allow the service to interact directly with messages. Message contracts can be typed or untyped, and are useful in interoperability cases and when there is an existing message format we have to comply with.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1054/what-are-contracts-in-wcf#a1055</guid>
<pubDate>Thu, 29 Jul 2010 14:10:40 +0000</pubDate>
</item>
<item>
<title>Answered: What is Proxy and how to generate proxy for WCF Services?</title>
<link>http://prepare4interview.com/1051/what-is-proxy-and-how-to-generate-proxy-for-wcf-services#a1052</link>
<description>The proxy is a CLR class that exposes a single CLR interface representing the service contract. The proxy provides the same operations as service's contract, but also has additional methods for managing the proxy life cycle and the connection to the service. The proxy completely encapsulates every aspect of the service: its location, its implementation technology and runtime platform, and the communication transport. &lt;br /&gt;
&lt;br /&gt;
The proxy can be generated using Visual Studio by right clicking Reference and clicking on Add Service Reference. This brings up the Add Service Reference dialog box, where you need to supply the base address of the service (or a base address and a MEX URI) and the namespace to contain the proxy. &lt;br /&gt;
&lt;br /&gt;
Proxy can also be generated by using SvcUtil.exe command-line utility. We need to provide SvcUtil with the HTTP-GET address or the metadata exchange endpoint address and, optionally, with a proxy filename. The default proxy filename is output.cs but you can also use the /out switch to indicate a different name. &lt;br /&gt;
&lt;br /&gt;
SvcUtil http://localhost/MyService/MyService.svc /out:Proxy.cs &lt;br /&gt;
&lt;br /&gt;
When we are hosting in IIS and selecting a port other than port 80 (such as port 88), we must provide that port number as part of the base address: &lt;br /&gt;
&lt;br /&gt;
SvcUtil http://localhost:88/MyService/MyService.svc /out:Proxy.cs</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1051/what-is-proxy-and-how-to-generate-proxy-for-wcf-services#a1052</guid>
<pubDate>Thu, 29 Jul 2010 14:09:36 +0000</pubDate>
</item>
<item>
<title>Answered: What are different elements of WCF Srevices Client configuration file?</title>
<link>http://prepare4interview.com/1048/what-different-elements-srevices-client-configuration-file#a1049</link>
<description>WCF Services client configuration file contains endpoint, address, binding and contract. A sample client config file looks like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;client&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;endpoint name = &amp;quot;MyEndpoint&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;address &amp;nbsp;= &amp;quot;http://localhost:8000/MyService/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;binding &amp;nbsp;= &amp;quot;wsHttpBinding&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;contract = &amp;quot;IMyContract&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/client&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system.serviceModel&amp;gt;</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1048/what-different-elements-srevices-client-configuration-file#a1049</guid>
<pubDate>Thu, 29 Jul 2010 14:08:38 +0000</pubDate>
</item>
<item>
<title>Answered: What is Transport and Message Reliability?</title>
<link>http://prepare4interview.com/1045/what-is-transport-and-message-reliability#a1046</link>
<description>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. &lt;br /&gt;
&lt;br /&gt;
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.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1045/what-is-transport-and-message-reliability#a1046</guid>
<pubDate>Thu, 29 Jul 2010 14:07:50 +0000</pubDate>
</item>
<item>
<title>Answered: How to configure Reliability while communicating with WCF Services?</title>
<link>http://prepare4interview.com/1042/configure-reliability-while-communicating-with-services#a1043</link>
<description>Reliability can be configured in the client config file by adding reliableSession under binding tag. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;services&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;service name = &amp;quot;MyService&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;endpoint&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;address &amp;nbsp;= &amp;quot;net.tcp://localhost:8888/MyService&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;binding &amp;nbsp;= &amp;quot;netTcpBinding&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bindingConfiguration = &amp;quot;ReliableCommunication&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;contract = &amp;quot;IMyContract&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/service&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/services&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;bindings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;netTcpBinding&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;binding name = &amp;quot;ReliableCommunication&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;reliableSession enabled = &amp;quot;true&amp;quot;/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/binding&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/netTcpBinding&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/bindings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reliability is supported by following bindings only &lt;br /&gt;
&lt;br /&gt;
NetTcpBinding &lt;br /&gt;
WSHttpBinding &lt;br /&gt;
WSFederationHttpBinding &lt;br /&gt;
WSDualHttpBinding</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1042/configure-reliability-while-communicating-with-services#a1043</guid>
<pubDate>Thu, 29 Jul 2010 14:06:43 +0000</pubDate>
</item>
<item>
<title>Answered: How to deal with operation overloading while exposing the WCF services?</title>
<link>http://prepare4interview.com/1040/deal-with-operation-overloading-while-exposing-wcf-services#a1041</link>
<description>By default overload operations (methods) are not supported in WSDL based operation. However by using Name property of OperationContract attribute, we can deal with operation overloading scenario. &lt;br /&gt;
&lt;br /&gt;
[ServiceContract]&lt;br /&gt;
&lt;br /&gt;
interface ICalculator&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[OperationContract(Name = &amp;quot;AddInt&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;int Add(int arg1,int arg2);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[OperationContract(Name = &amp;quot;AddDouble&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;double Add(double arg1,double arg2);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice that both method name in the above interface is same (Add), however the Name property of the OperationContract is different. In this case client proxy will have two methods with different name AddInt and AddDouble.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1040/deal-with-operation-overloading-while-exposing-wcf-services#a1041</guid>
<pubDate>Thu, 29 Jul 2010 14:05:56 +0000</pubDate>
</item>
<item>
<title>Answered: How to set the timeout property for the WCF Service client call?</title>
<link>http://prepare4interview.com/1037/how-set-the-timeout-property-for-the-wcf-service-client-call#a1038</link>
<description>The timeout property can be set for the WCF Service client call using binding tag. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;client&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;endpoint&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;binding = &amp;quot;wsHttpBinding&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bindingConfiguration = &amp;quot;LongTimeout&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/client&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;bindings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;wsHttpBinding&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;binding name = &amp;quot;LongTimeout&amp;quot; sendTimeout = &amp;quot;00:04:00&amp;quot;/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/wsHttpBinding&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/bindings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no timeout has been specified, the default is considered as 1 minute.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1037/how-set-the-timeout-property-for-the-wcf-service-client-call#a1038</guid>
<pubDate>Thu, 29 Jul 2010 14:05:10 +0000</pubDate>
</item>
<item>
<title>Answered: What are the main components of WCF?</title>
<link>http://prepare4interview.com/1035/what-are-the-main-components-of-wcf#a1036</link>
<description>The main components of WCF are &lt;br /&gt;
&lt;br /&gt;
1. Service class &lt;br /&gt;
2. Hosting environment &lt;br /&gt;
3. End point</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1035/what-are-the-main-components-of-wcf#a1036</guid>
<pubDate>Thu, 29 Jul 2010 14:03:57 +0000</pubDate>
</item>
<item>
<title>Answered: What was the code name for WCF?</title>
<link>http://prepare4interview.com/1033/what-was-the-code-name-for-wcf#a1034</link>
<description>The code name of WCF was Indigo . &lt;br /&gt;
&lt;br /&gt;
WCF is a unification of .NET framework communication technologies which unites the following technologies:- &lt;br /&gt;
&lt;br /&gt;
NET remoting &lt;br /&gt;
MSMQ &lt;br /&gt;
Web services &lt;br /&gt;
COM+</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1033/what-was-the-code-name-for-wcf#a1034</guid>
<pubDate>Thu, 29 Jul 2010 14:03:08 +0000</pubDate>
</item>
<item>
<title>Answered: What are various ways of hosting WCF Services?</title>
<link>http://prepare4interview.com/1030/what-are-various-ways-of-hosting-wcf-services#a1031</link>
<description>There are three major ways of hosting a WCF services &lt;br /&gt;
&lt;br /&gt;
• Self-hosting the service in his own application domain. This we have already covered in the first section. The service comes in to existence when you create the object of Service Host class and the service closes when you call the Close of the Service Host class. &lt;br /&gt;
&lt;br /&gt;
• Host in application domain or process provided by IIS Server. &lt;br /&gt;
&lt;br /&gt;
• Host in Application domain and process provided by WAS (Windows Activation Service) Server.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1030/what-are-various-ways-of-hosting-wcf-services#a1031</guid>
<pubDate>Thu, 29 Jul 2010 14:02:04 +0000</pubDate>
</item>
<item>
<title>Answered: What is the difference WCF and Web services?</title>
<link>http://prepare4interview.com/1028/what-is-the-difference-wcf-and-web-services#a1029</link>
<description>Web services can only be invoked by HTTP (traditional webservice with .asmx). While WCF Service or a WCF component can be invoked by any protocol (like http, tcp etc.) and any transport type. &lt;br /&gt;
&lt;br /&gt;
Second web services are not flexible. However, WCF Services are flexible. If you make a new version of the service then you need to just expose a new end. Therefore, services are agile and which is a very practical approach looking at the current business trends. &lt;br /&gt;
&lt;br /&gt;
We develop WCF as contracts, interface, operations, and data contracts. As the developer we are more focused on the business logic services and need not worry about channel stack. WCF is a unified programming API for any kind of services so we create the service and use configuration information to set up the communication mechanism like HTTP/TCP/MSMQ etc</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1028/what-is-the-difference-wcf-and-web-services#a1029</guid>
<pubDate>Thu, 29 Jul 2010 14:01:10 +0000</pubDate>
</item>
<item>
<title>Answered: What is three major points in WCF?</title>
<link>http://prepare4interview.com/1025/what-is-three-major-points-in-wcf#a1027</link>
<description>We Should remember ABC. &lt;br /&gt;
&lt;br /&gt;
Address --- Specifies the location of the service which will be like http://Myserver/MyService.Clients will use this location to communicate with our service. &lt;br /&gt;
&lt;br /&gt;
Binding --- Specifies how the two paries will communicate in term of transport and encoding and protocols &lt;br /&gt;
&lt;br /&gt;
Contract --- Specifies the interface between client and the server.It's a simple interface with some attribute.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/1025/what-is-three-major-points-in-wcf#a1027</guid>
<pubDate>Thu, 29 Jul 2010 13:59:01 +0000</pubDate>
</item>
<item>
<title>Answered: What are the important principles of SOA (Service oriented Architecture)?</title>
<link>http://prepare4interview.com/996/what-important-principles-service-oriented-architecture#a997</link>
<description>WCF is based on SOA. All big companies are playing big bets on SOA. So how can Microsoft remain behind? So in order to implement SOA architecture easily you need to use WCF.&lt;br /&gt;
SOA is based on four important concepts:-&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
• Boundaries are well defined&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In SOA, everything is formalized. The client who is consuming the service does not need to know how the implementation of the service is done. If you look at some old methodologies of communication like DCOM. Any changes at server level the client also has to change. Therefore, the server and client implementation was so much bound that changes need to be done at all places. In SOA, the rule is if you do enhancement you do not need to change anything at the client. SOA based application only understands that there is an end point, contract, and bindings.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Note: - Just to clarify shortly about end point and contract. Any SOA service is exposed through an end point. End point defines three important aspects What, Where and How. We will understand more details of the same in the later questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
• Services evolve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change is the law of nature and services will evolve. In SOA, services can be versioned and you can host those services in new ends. For instance, you have a service called as “Search Tickets (Ticket Number) “which gives details based on Ticket Number and its exposed on end point “ep1”. Tomorrow you want make your Search Tickets service more useful by also providing an extra option of allowing him to search by passenger name. Therefore, you just declare a new end “ep2” with service “Search Tickets (Ticket Number, Passenger Name)”. So the client who is consuming the service at end ep1 continues and at the other end, we have evolved our service by adding new ends ep2.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
• Services share only schemas and contracts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Services use Schemas to represent data and contracts to understand behavior. They do not use language dependent types or classes in order to understand data and behavior. XML is used to define schemas and contracts. Due to this, there is not heavy coupling between environments.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
• Service compatibility is policy based&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Policy describes the capabilities of the system. Depending on policies, the service can degrade to match the service for the client. For instance your service needs to be hosted for two types of client one which uses Remoting as the communication methodology while other client uses DCOM. An ideal SOA service can cater to both of them according to there communication policies.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/996/what-important-principles-service-oriented-architecture#a997</guid>
<pubDate>Thu, 29 Jul 2010 08:50:22 +0000</pubDate>
</item>
<item>
<title>Answered: What is Windows Card Space?</title>
<link>http://prepare4interview.com/994/what-is-windows-card-space#a995</link>
<description>It was previously known by its codename Info Card. It is a framework by Microsoft, which securely stores digital identities of a user and provides a unified interface to choose the identity for a particular transaction, such as logging in to a website. Windows Card Space is a central part of Microsoft’s effort to create an identity met system, or a unified, secure and interoperable identity layer for the internet.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/994/what-is-windows-card-space#a995</guid>
<pubDate>Thu, 29 Jul 2010 08:44:29 +0000</pubDate>
</item>
<item>
<title>Answered: What is .NET 3.0?</title>
<link>http://prepare4interview.com/992/what-is-net-3-0#a993</link>
<description>In one simple equation .NET 3.0 = .NET 2.0 + Windows Communication Foundation + Windows Presentation Foundation + Windows Workflow Foundation + Windows Card Space.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/992/what-is-net-3-0#a993</guid>
<pubDate>Thu, 29 Jul 2010 08:42:47 +0000</pubDate>
</item>
<item>
<title>Answered: What are the various ways of hosting a WCF service?</title>
<link>http://prepare4interview.com/990/what-are-the-various-ways-of-hosting-a-wcf-service#a991</link>
<description>Self hosting the service in his own application domain. The service comes in to existence when you create the object of ServiceHost class and the service closes when you call the Close of the ServiceHost class. &lt;br /&gt;
Host in application domain or process provided by IIS Server. &lt;br /&gt;
Host in Application domain and process provided by WAS (Windows Activation Service) Server.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/990/what-are-the-various-ways-of-hosting-a-wcf-service#a991</guid>
<pubDate>Thu, 29 Jul 2010 08:33:30 +0000</pubDate>
</item>
<item>
<title>Answered: Difference between WCF and Web services?</title>
<link>http://prepare4interview.com/988/difference-between-wcf-and-web-services#a989</link>
<description>Web Services &lt;br /&gt;
&lt;br /&gt;
1.It Can be accessed only over HTTP &lt;br /&gt;
2.It works in stateless environment &lt;br /&gt;
&lt;br /&gt;
WCF &lt;br /&gt;
&lt;br /&gt;
WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting WCF services: &lt;br /&gt;
IIS &lt;br /&gt;
WAS &lt;br /&gt;
Self-hosting &lt;br /&gt;
Managed Windows Service</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/988/difference-between-wcf-and-web-services#a989</guid>
<pubDate>Thu, 29 Jul 2010 08:27:42 +0000</pubDate>
</item>
<item>
<title>Answered: What is WCF?</title>
<link>http://prepare4interview.com/986/what-is-wcf#a987</link>
<description>Windows Communication Foundation (WCF) is an SDK for developing and deploying services on Windows. WCF provides a runtime environment for services, enabling you to expose CLR types as services, and to consume other services as CLR types. &lt;br /&gt;
&lt;br /&gt;
WCF is part of .NET 3.0 and requires .NET 2.0, so it can only run on systems that support it. &lt;br /&gt;
&lt;br /&gt;
(content from another post: http://www.dotnetfunda.com/interview/exam283-what-is-wcf.aspx)</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/986/what-is-wcf#a987</guid>
<pubDate>Thu, 29 Jul 2010 08:25:24 +0000</pubDate>
</item>
<item>
<title>Answered: What is a SOA Service?</title>
<link>http://prepare4interview.com/983/what-is-a-soa-service#a984</link>
<description>SOA is Service Oriented Architecture. SOA service is the encapsulation of a high level business concept. A SOA service is composed of three parts. &lt;br /&gt;
1. A service class implementing the service to be provided. &lt;br /&gt;
2. An environment to host the service. &lt;br /&gt;
3. One or more endpoints to which clients will connect.</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/983/what-is-a-soa-service#a984</guid>
<pubDate>Thu, 29 Jul 2010 08:02:27 +0000</pubDate>
</item>
<item>
<title>Answered: What is the use of ServiceBehavior attribute in WCF ?</title>
<link>http://prepare4interview.com/981/what-is-the-use-of-servicebehavior-attribute-in-wcf#a982</link>
<description>ServiceBehaviour attribute is used to specify the InstanceContextMode for the WCF Service class (This can be used to maintained a state of the service or a client too) &lt;br /&gt;
&lt;br /&gt;
There are three instance Context Mode in the WFC &lt;br /&gt;
&lt;br /&gt;
PerSession : This is used to create a new instance for a service and the same instance is used for all method for a particular client. (eg: State can be maintained per session by declaring a variable) &lt;br /&gt;
&lt;br /&gt;
PerCall : This is used to create a new instance for every call from the client whether same client or different. (eg: No state can be maintained as every time a new instance of the service is created) &lt;br /&gt;
&lt;br /&gt;
Single : This is used to create only one instance of the service and the same instance is used for all the client request. (eg: Global state can be maintained but this will be applicable for all clients)</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/981/what-is-the-use-of-servicebehavior-attribute-in-wcf#a982</guid>
<pubDate>Thu, 29 Jul 2010 07:57:12 +0000</pubDate>
</item>
<item>
<title>Answered: Which namespace is required in a class to use DataContract or DataMember attribute for a class or properties?</title>
<link>http://prepare4interview.com/979/namespace-datacontract-datamember-attribute-properties#a980</link>
<description>sing System.Runtime.Serialization namespace has all required objects that can be used to make an object serializable. In WCF, in order to expose the object or property as transportable, you need to use DataContract or DataMember</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/979/namespace-datacontract-datamember-attribute-properties#a980</guid>
<pubDate>Thu, 29 Jul 2010 07:53:41 +0000</pubDate>
</item>
<item>
<title>Answered: List some main differences between asp.net 1.1 and asp.net 2.0?</title>
<link>http://prepare4interview.com/975/list-some-main-differences-between-asp-net-1-1-and-asp-net-2-0#a976</link>
<description>Asp.net 2.0 introduces may new Server Controls that enable powerful declarative support for data access, login security, menus, tree views, and many more. &lt;br /&gt;
&lt;br /&gt;
•In asp.net 2.0 there is no need to make a Virtual directory, your application run on local server of asp.net 2.0.&lt;br /&gt;
•In asp.net 2.0 there is no concept of Project but only solution file is there.&lt;br /&gt;
•When you create a new asp.net 2.0 application then only default page and an App_Data folder is in the solution.You have to explicitily add other files.&lt;br /&gt;
Except these asp.net 2.0 have..&lt;br /&gt;
•Master Pages : This feature is used to define common structure and interface for your site like Page header, Footer ,navigation links. These common elements are shared by many pages in your site which access master pages. In other words we can say that you can control the look, feel and much of functionality of your entire Web Site.This improves the maintablity and avoids the duplication of code for site structure or behaviour.&lt;br /&gt;
•Personalization : Personalization means custamizing the Web Application according to user account. The profile object is used to build strongly typed,strict data access for user accounts. This also provide a Web Site visitor to Completly control the layout and behaviour of the site.&lt;br /&gt;
•Asp.Net MMC admin Tool : asp.net 2.0 provides a new comprehensive admin tool the plugs into the existing IIS Administration MMC, enabling an administrator to graphically read, or change common settings within the XML config files.&lt;br /&gt;
•64 bit support : Asp.net 2.0 in 64 bit enabled and can take advantage of full memory address space of new 64 bit processor and servers. Programmers can just copy 32-bit asp.net applications onto a 64 bit asp.net 2.0 server and have the</description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/975/list-some-main-differences-between-asp-net-1-1-and-asp-net-2-0#a976</guid>
<pubDate>Wed, 28 Jul 2010 10:07:58 +0000</pubDate>
</item>
<item>
<title>Explain Singleton architecture of Remoting.</title>
<link>http://prepare4interview.com/757/explain-singleton-architecture-of-remoting</link>
<description></description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/757/explain-singleton-architecture-of-remoting</guid>
<pubDate>Fri, 23 Jul 2010 17:17:38 +0000</pubDate>
</item>
<item>
<title>Describe SAO architecture of Remoting.</title>
<link>http://prepare4interview.com/755/describe-sao-architecture-of-remoting</link>
<description></description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/755/describe-sao-architecture-of-remoting</guid>
<pubDate>Fri, 23 Jul 2010 17:17:33 +0000</pubDate>
</item>
<item>
<title>Explain the two different types of remote object creation mode in .NET.</title>
<link>http://prepare4interview.com/753/explain-the-two-different-types-remote-object-creation-mode</link>
<description></description>
<category>.NET Interview Questions and Answers</category>
<guid isPermaLink="true">http://prepare4interview.com/753/explain-the-two-different-types-remote-object-creation-mode</guid>
<pubDate>Fri, 23 Jul 2010 17:17:09 +0000</pubDate>
</item>
</channel>
</rss>
