Create WCF Service

How to the create a service using serviceModel.dll library:

Run visual studio in Administrator mode then create console based application -- say myservice --  then under the project add reference System.ServiceModel.dll.



Then add Interface -> say IMyservic then use Namespace Using System.ServiceModel then write the code like that.



Then we are creating Class, say Myser.cs, then extend this class with interface and implement all methods.



Next step -> go to the program.cs and write the code for Hosting and Endpoint information.



Next step run the Application.



My service starts, then the next step is to open the command prompt to find if my service has really run or not, but Debug mode hasn't stopped so you can’t find if the service is really running or not .. now open the command prompt, type netstat -a command,  that’s a command for getting the current service in PCs.

Ebook Download
View all
Learn
View all