WCF Address Types and Formats



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

Endpoint addresses are formatted based on the selected transport used in communication. As in the example above, most address formats contain

the following parts:

  • 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.
Now we will list different Address Formats and the differences.

  • 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]


Hope this articles helps you all, in understanding different types of address formats.


Similar Articles