Introduction
The three important components of an endpoint is address, binding and contract. Address is the heart of an endpoint or the main important component of the endpoint. Without the address we cannot find the endpoint to begin with; basically without the address the endpoints are useless. Address specifies where the service endpoint is. Every endpoint must have an address to which the endpoint is associated.
For example, an address might look like: http://www.c-sharpcorner.com/Publish
Here, http: -: the transport protocol.
//www.c-sharpcorner.com -: website or machine running the service.
/Publish -: the path to the specific service endpoint.
Address Types
Different types of addresses are associates with each endpoints and it is through addresses that the client communicates with the end point.
- Endpoint Address
The example given above specifies the address of a specific service endpoint which client can access.
Once the client has accessed the service from above endpoint address, all the communication happens
- Base Address
Base address provide a way to specify a single, primary address for a given service and assign relative addresses to each individual endpoint.
For example this base address assigned to a service: http://www.c-sharpcorner.com/Publish.
Also we can have multiple individual endpoints to the address above.
http://www.c-sharpcorner.com/Publish/service1
http://www.c-sharpcorner.com/Publish/service2
http://www.c-sharpcorner.com/Publish/service3
http://www.c-sharpcorner.com/Publish/service4 etc..
- MEX (Metadata exchange) Address
Address allows a client to gather information about a particular service. MEX is an http endpoint address used to obtain service information.
The information is provided through the service metadata, which describes the service.
For example: http://www.c-sharpcorner.com/Publish/mex
Address Formats
- Scheme that specifies the protocol.
- A fully qualified domain name.
- Based on requirements some services uses ports (default 80)
- The specific or multiples paths of the services.
- HTTP Address
The most common address format for a service is HTTP Address.
format: http://domainname|machinename [:port]/path or paths
- HTTPS Address
Same as HTTP Address but HTTPS ca be secured by using SSL (Secure Socket Layer) and need to obtain a valid certificates.
format: https://domainname|machinename [:port]/path or paths
- TCP Address
WCF provides a new TCP based network protocol for high performance communication.
format: net.tcp://domainname|machinename [:port]/path or paths
- MSMQ Address
MSMQ address format differs from others.
format: net.msmq://host name/ [private]/queue-name
- Scheme that specifies the MSMQ protocol.
- A fully qualified domain name of the machine running MSMQ or localhost.
- [private] is optional, but when used it contains the address of a target queue that is private queue.
- Queue-name is the name of the MSMQ name.
- Named Pipe Address
This address has no port number and communication using named pipes cannot be "cross-machine" (between two machines).
format: net.pipe://localhost/service
- IIS Address
Here also a different in address format because IIS address requires a virtual directory name as well as a service (.svc) filename.
format: http://domainname|machinename [:port]/virtual directory name [.svc filename]

David BrowneditedPosted Mar 31, 2011, 12:20 PMEdited Mar 31, 2011, 12:23 PM
Not that this should affect the endpoint issue, but the WCF service will be implemented as a Singleton, as it interfaces with a single piece of hardware on the local machine.
David BrownPosted Mar 31, 2011, 12:19 PM
Thank you for your article on WCF addressing. I have a slightly different addressing issue. I would like to have a WCF service installed on local machines hosted as a Windows service. This service serves as the interface to hardware installed on the local machine. The service will use NetTcpBinding with contracts defining the API. I would like to allow a remote web server to be a client to this service. The scenario would be as follows: A user connects to the remote web server from their browser. The web server (somehow) uses the address of the client and a known fixed port number to connect to the WCF service endpoint on the user's local machine. The web server can then access and control the user's local hardware using the service and data contracts. How do I set the address portion of the endpoint on both the WCF service and in the remote client? There could be any number of local machines with their own hardware, so the IP address for any given connection will always be different. Thanks, Dave Brown