using netTcpBinding in WCF
Posted by anup hosur
category on 11/15/2009
for Beginner level | Views : 47408
If you found plagiarised (copied)
or inappropriate content,
please let us know
the original source along with your correct email id (to communicate) for further action.
Rating: 5 out of 5
In this article we are going to use netTcpBinding in WCF.
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
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.
Give the Reference to System.ServiceModel. Now lets write our ServiceContract,OperationContract and so on.
It just prints the value whatever we enter.
Now lets write the servicehost to our application.
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.
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.
Now give a Reference to System.ServiceModel. Then write these of lines in the Program.cs
Now lets run this application
I hope you people like this application. Thank you.
About the Author