SSl with self hosted WCf Services

Posted by in WCF category on for Beginner level | Views : 25271 red flag

In this article, we are going to see how to use Transport Security with Self hosting by using SSL.

       In this article,we are going to see how to use Transport security with Self Hosting by using SSL. Please Refer this link This link contains information about how to set SSl for Self hosting.

Lets go through this application step by step


      Open VS 2008>New Project>Console Application>Give the name> Select c# as a programming language.


      Now give System.ServiceModel reference to the console application project.


      Now,lets write Service Contract,operation contract and so on in our service application.


I am setting the port to 8000. your url format should be like this https://computername:port no/service name


        Now lets config the application configuration file(app.config). For configuring app.config, i am using a tool called WCF Service Configuration Editor. Please refer this link It contains information about WCF Service Configuration Editor.



        Now check whether your application is running properly. If any errors fix those. 


        Now, Lets create the client application. give reference to System.ServiceModel. lets use a tool called Svcutil.exe to generate the proxy. open VS cmd prompt> type in as svcutil /out:proxy.cs /config:app.config "https://computer name:8000/service" . It will automatically generate proxy.cs and app.config in the specific location. Copy those files and pate it into our client app. 

        Now write these lines in the program.cs file


         Now Lets run this application

    I hope you people like this article.

Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: anup hosur
Member Level:
Member Status: Member
Member Since: 8/1/2009 2:37:23 AM
Country: India
He is the .net developer with around 8 years of experience in technologies like c#, WCF, WPF and

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)