Home > Articles > WCF >

 using netTcpBinding in WCF

Anup1252000
Posted by under WCF category on for Beginner level | Views : 48726 red flag
Rating: 5 out of 5
1 vote(s)
In this article we are going to use netTcpBinding in WCF.
Introduction
In this article, we are going to use netTcpBinding in WCF. 

Advantages of using Net.Tcp are as follows:
         1) It can be used for high performance communication.
         2) Net.Tcp Port sharing service enables net.tcp port to be shared across multiple user processes.


Lets go through this application step by step

Step1: 

         In this application, we are going to use Console Application. Open VS2008>New>Project>Console Application>Select language as c#>give the name of the project.


Step2:

       Give the Reference to System.ServiceModel. Now lets write our ServiceContract,OperationContract and so on.



It just prints the value whatever we enter.


Step3:

         Now lets configure the app.config. I suggest you to use WCF Service Configuration Editor Tool. If you dont know how to use it then go through this article http://msdn.microsoft.com/en-us/library/ms732009.aspx.
         
          


Step4:

        Now lets write the servicehost to our application.




Step5:

         Now we are using a tool called svcutil. 
        You need to type in VS command Prompt like this
        svcutil /out:proxy.cs /config:app.config "http://localhost:8025/Service"
        It will generate proxy.cs and app.config.


Step6:

        Now lets create a client application. New>Project>Console Application>give the name.
        Copy and paste the proxy.cs and app.config from the particular location and paste into client application.


Step7:

        Now give a Reference to System.ServiceModel. Then write these of lines in the Program.cs



Step8:

        Now lets run this application 



I hope you people like this application. Thank you.
Page copy protected against web site content infringement by Copyscape
About the Author
Anup1252000
Full Name: anup hosur
Member Level:
Member Status: Member
Member Since: 8/1/2009 2:37:23 AM
Country: India


Login to vote for this post.


Comments or Responses

Posted by: Gaur1982 on: 8/14/2013 | Points: 25
Want to know much more about NetTcpBinding in WCF...
Visit this link it has lots of information..
http://www.planetofcoders.com/nettcpbinding-in-wcf/

Login to post response

Comment using Facebook(Author doesn't get notification)