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

  • Nominate yourself for "Agile Software Development using Scrum" online session for FREE, click here (Hurry, limited seats).

  • Download OOPS and ASP.NET Online training session video and PPT from here.

Submit Article | Articles Home | Search Articles |

using netTcpBinding in WCF

 Posted on: 11/15/2009 6:33:39 PM by Anup1252000 | Views: 1692 | Category: WCF | Level: Beginner | Print Article
In this article we are going to use netTcpBinding in WCF.

Ask all your .NET related questions/clarifications here to get quicker solution.

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.

Interesting?   Share and Bookmark this kick it on DotNetKicks.com


About anup hosur

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

   ◘ Ajax Enabled WCF Service posted on 2/15/2010 1:10:10 AM
   ◘ Membership provider with WCF posted on 2/11/2010 7:00:47 AM
   ◘ Creating Multiple Channels in Channel factory in WCF posted on 2/11/2010 4:06:00 AM
   ◘ WCF Hosting in Windows Services posted on 1/28/2010 7:53:50 AM
   ◘ SSl with self hosted WCf Services posted on 11/25/2009 5:35:18 PM


Submit Article

About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)