Go to DotNetFunda.com
 Online : 700 |  Welcome, Guest!   Login
 
Home > Articles > WCF > using netTcpBinding in WCF

Submit Article | Articles Home | Search Articles |

using netTcpBinding in WCF

1 vote(s)
Rating: 5 out of 5
red flag  Posted on: 11/15/2009 6:33:39 PM by Anup1252000 | Views: 5338 | Category: WCF | Level: Beginner


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.

If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Found interesting? Add this to:

| More



Please Sign In to vote for this post.

 
Latest post(s) from Anup1252000

Latest Articles

About anup hosur

Experience:2 year(s)
Home page:
Member since:Saturday, August 01, 2009
Level:Starter
Status: [Member]
Biography:

Submit Article

About Us | The Team | Advertise | Contact Us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 9/3/2010 4:01:13 AM