WCF Interview Questions and Answers Part 4

By
1.) What is HTTP Addressing Formats in WCF ?                                                                
  The Services using HTTP can either be self -hosted or hosted on IIS.
  • The following format is used is used while addressing the self hosted HTTP Service :-
http://localhost:8080/services/MyfirstServices  
  • If the HTTP services is hosted on IIS ,the Secure Socket Layer(SSL) Protocol is required,for which you need to replace the http service with the https service. in wcf configuration, You can define the HTTP Address as following:- 
<endpoint
address="http://localhost:8080/services/MyfirstServices"
bindingSectionName="HTTPBinding"
contracts ="IExchange" />                                            
2.) What is TCP Addressing Formats in WCF ?                                                                 
The TCP address uses the same addressing rules as used by the HTTP address,excluding the scheme.The format of tcp address is as follows:-  
  net.tcp://localhost:8080/services/MyfirstServices                                           
In wcf configuration, You can define the tcp Address as following:- 
<endpoint
adddress="net.tcp://localhost:8080/services/MyfirstServices"
bindingSectionName="TCPBinding"
contracts ="IExchange" />
3.) What is MSMQ Addressing Formats in WCF ?                                                             
The MSMQ address contains two type of messaging patterns to transport asynchronous one-way and duplex type of patterns.It contains two types of queues,public and private.Public queues are the active queues that can be accessed by any remote system,whereas,private queues are the local queues that can only be accessible from a local machine.MSMQ addresses use the net.msmq scheme to transport messages from the server to the client .   
An msmq address is a s follows:-
  net.msmq://localhost/Private/MyfirstServices  

The format of defining the MSMQ address in the wcf configuration as follows:-
<endpoint
adddress="net.msmq://localhost/Private/MyfirstServices"
bindingSectionName="MSMQBinding"
contracts ="IExchange" />
4.) What is Named pipes Addressing Formats in WCF ?                                                  
 The services using named pipes address can only accept calls from the same machine.This address can be used for single (one-way) or duplex communication between process on a single computer.The formats of named pipe address is as follows:-
net.pipe://localhost/Services/MyfirstServices  
The format of defining the named pipes address in the wcf configuration as follows; 
<endpoint
adddress="net.pipe://localhost/Services/MyfirstServices"
bindingSectionName="NamedPipesBinding"
contracts ="IExchange" />

5.) What is IIS Addressing Formats in WCF ?                                                                      
An IIS address contains scheme,domain name ,port number ,name of the virtual directory and service (.svc) file name.The format of an IIS address is as follows:-
http://domain_name:8080/virtual directory [.svc file name]

6.) What is Base Address in WCF ?                                                                                          
A WCF service itself has an address known as base address.It can have multiple base address ,but only one per Uniform Resource Identifier(URI) scheme.
<host>
<baseAddress>
<add baseAddress="http://localhost:8080/services/MyfirstServices"/>
<add baseAddress="net.tcp://localhost:8080/services/MyfirstServices"/>
<baseAddress>
</host>
//This allow you to define following endpoints
<endpoint
name="HTTPBinding"
adddress="Exchange"
bindingSectionName="HTTPBinding"
contracts ="IExchange" />
name="TCPBinding"
adddress="Exchange"
bindingSectionName="TCPBinding"
contracts ="IExchange" />

7.) What are the predefined bindings used to facilitate communication in WCF ?
  • basicHttpBinding
  • wsHttpBinding
  • wsdualHttpBinding
  • wsfederationHttpBinding
  • netTcpBinding
  • netNamedPipeBinding
  • netMsmqBinding
  • msmqInterationBinding
  • netPeerTCPBinding
8.) What are the protocols used by transport layer in WCF ?                                        
  • HTTP
  • HTTPs
  • TCP
  • Named pipes
9.) Which protocol is known as  request/response between server and client ?    
HTTP Protocol
10.) Why does we use  named pipes protocol in wcf ?                                                
The named pipes protocols is used when communication is required between different wcf application on the same machine and you do not want to communicate with another machine.The named pipes protocol has a name and can be used for one-way or duplex communication on the same machine.

More .NET Interview Questions and Answers

0 comments:

Post a Comment

Powered by Blogger.