Remove the Anonymous Authentication Exception in WCF

This article explains how to remove the "Anonymous Authentication" exception that occurs at the time of a WCF service (3.5 Framework) hosting on IIS.

Description

This article explains how to remove the "Anonymous Authentication" exception at the of WCF service hosting on IIS, that you create in the 3.5 Framework.

Introduction

Let's take a real current scenario, I have a web service in a website (.Net framework 3.5) that is running on the server and I am using that web service in my Windows application. Now I want to replace the web service with a WCF service.

To explain this I will create:

  • A website with a Default page
  • A WCF service in it instead of a web service

Use the following procedure to do that.

Step 1: Add a new website named "Wcf_Example" using the 3.5 Framework.



Step 2: Add a WCF Service named "MYService.svc" into it.



Which will create the following 3 files:

  • IMYService.cs: Contains an interface of the MYService class
  • MYService.cs: Contains the MYService class
  • MYService.svc: Contains the details required for the WCF service to run it successfully; like a .asmx in a web service



Problem: Get the exception when I run the service "http://localhost/WCF_Example/MYService.svc".



Solution: Open the Control Panel and click on "Turn Windows features on or off".



Check the "Windows Communication Foundation HTTP Activation" and "Windows Communication Foundation Non- HTTP Activation".



Now run the WCF Service "http://localhost/WCF_Example/MYService.svc".


 

Up Next
    Ebook Download
    View all
    Learn
    View all