WCF Address


Introduction

WCF Address is the one of the measure element of WCF Service Endpoint. It contains the location of the WCF Service. This article describes details about WCF Address and the address format of the different schemes.

Getting Started

The address is the URL that defines the location of service. The address is a way of letting the client know that where a service is located. in Wcf, every service associated with a unique address which contains the location of the service and transport schemas.

The address format of WCF Transport schema always follows.




 [Transport] ://[Domain Name or Machine Name]:[Port]//[Service Name]   

WCF Supports following transport schemas

  1. HTTP
  2. TCP
  3. Per Network
  4. IPC(Inter-Process Communication over named pipes)
  5. MSMQ

Examples

HTTP Address Format

 http://localhost:81/MyService   
When the port number is not specified, the default port is 80.
 http://localhost/MyService   
TCP ddress Format
 net.tcp://localhost:82/MyService   
When a port number is not specified, the default port is 808.
 net.tcp://localhost/MyService   




Two HTTP and TCP address from the same host can share a port, even on the same matchine.

IPC Address Format

This address has no port number and communication using named pipes cannot be "cross-machine" (between two machines). Here also a different address format because IIS address requires a virtual directory name as well as a service (.svc) filename. 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.
 net.pipe://localhost/MyService   

MSMQ Address Format

MSMQ address format differs from others.
 net.msmq://localhost/private/MyService  
 net.msmq://localhost/MyService  
[private] is optional, but when used it contains the address of a target queue that is private queue.

Related Articles

  1. WCF Bindings
  2. WCF Contracts
  3. WCF Endpoints

Summary

In the above of this article we have discussed about WCF Address and different address format,Hope this article will make you helpful

Thanks


No comments:

Post a Comment