MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

WCF

WCF Examples

WCF

WCF Projects

WCF Project

WCF Endpoints
Previous Home Next

In WCF the relationship between Address, Contract and Binding is called Endpoint. The Endpoint is the fusion of Address, Contract and Binding. WCF formalizes this relationship in the form of an endpoint.

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

 

Administrative Endpoint Configuration

Configuring an endpoint administratively requires placing the endpoints in the hosting process' config file. For example, given this service definition:

namespace endname
{
   [ServiceContract]
   interface IMyContract
   {...}
   class MyService : IMyContract
   {...}
}

Example:

<system.serviceModel>
<services>
<service name="MyNamespace.MyService">
<endpoint address="http://localhost:8000/MyService/"
          binding="wsHttpBinding" contract="MyNamespace.IMyContract"/>
</service>
</services>
</system.serviceModel>


Multiple endpoints on the same service:

<servicename="MyService">
<endpoint address="http://localhost:8000/MyService/"
          binding="wsHttpBinding" contract="IMyContract"/>
<endpoint address="net.tcp://localhost:8001/MyService/"
          binding="netTcpBinding" contract="IMyContract"/>
<endpoint address="net.tcp://localhost:8002/MyService/"
          binding="netTcpBinding" contract="IMyOtherContract"/>
</service>

Service-side binding configuration:

<system.serviceModel>
<services>
<service name = "MyService">
<endpoint address  = "net.tcp://localhost:8000/MyService/"
          bindingConfiguration = "TransactionalTCP" 
	  binding  = "netTcpBinding" contract = "IMyContract"/>
<endpoint address  = "net.tcp://localhost:8001/MyService/"
          bindingConfiguration = "TransactionalTCP"
	  binding  = "netTcpBinding" contract = "IMyOtherContract"/>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name = "TransactionalTCP" transactionFlow = "true"/>
</netTcpBinding>
</bindings>
</system.serviceModel>

Service-side programmatic endpoint configuration:

ServiceHost host = new ServiceHost(typeof(MyService));
Binding wsBinding  = new WSHttpBinding( );
Binding tcpBinding = new NetTcpBinding( );
host.AddServiceEndpoint(typeof(IMyContract),wsBinding,
            "http://localhost:8000/MyService");
host.AddServiceEndpoint(typeof(IMyContract),tcpBinding,
            "net.tcp://localhost:8001/MyService");
host.AddServiceEndpoint(typeof(IMyOtherContract),tcpBinding,
            "net.tcp://localhost:8002/MyService");
host.Open( );
</system.serviceModel>

AddServiceEndpoint( ) It adds a service endpoint to the hosted service with a specified contract, binding, and endpoint address.

Previous Home Next